// project created on 10/24/2005 at 7:53 PM
using System;
using System.Data;
using Gtk;
using Glade;
using Gdk;
using MySql.Data;
using MySql.Data.MySqlClient;
using Mono.Data;
using System.Configuration;
using System.Threading;
namespace Expector
{
public class cl_Main
{
object mainwindow = cl_mainwindow();
public static void Main (string[] args)
{
if (args[0] == "-debug")
{
Console.WriteLine("Debugging...");
Console.WriteLine("In Main()");
cl_Vars.debug = 1;
}
cl_config config = new cl_config();
config.readconfig();
if (cl_Vars.debug == 1)
{
Console.WriteLine("UserName = " + cl_Vars.UserName);
Console.WriteLine("Server = " + cl_Vars.Server);
Console.WriteLine("Database = " + cl_Vars.Database);
}
cl_timer s = new cl_timer();
TimerCallback timerDelegate = new TimerCallback(CheckStatus);
Timer timer = new Timer(timerDelegate, s, 1000, 1000);
s.tmr = timer;
timer.InitializeLifetimeService();
Application.Init ();
cl_loginwindow loginwindow = new cl_loginwindow ();
Application.Run ();
}
static void CheckStatus(object state)
{
cl_timer s = (cl_timer) state;
if (cl_Vars.loggedin == 1)
{
Console.WriteLine(s.counter);
s.counter++;
if (s.counter >= cl_Vars.secs_to_wait)
{
Console.WriteLine("Time to run... Something...");
s.counter = 0;
//this is broken
(cl_mainwindow)mainwindow.populate_myissues();
}
}
}
}
public class cl_Vars
{
public static int debug;
public static string ConnectionString;
public static string UserName;
public static string PassWord;
public static string Server;
public static string Database;
public static string Logo;
public static string EmployeeNumber;
public static int logins = 0;
public static int loggedin = 0;
public static int secs_to_wait = 60;
}
class cl_timer
{
public Timer tmr;
public int counter = 0;
}
}