Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ConnectsToGC.Setup();
            dbHelper = new DBHelper();

            downloadMonitor = new DownloadMonitor(dbHelper.db);
            downloadMonitor.rootDir =  "C:\\test";
            downloadTimer = new System.Threading.Timer(DownloadCheck, null, 4000, Timeout.Infinite);
            consumerTimer = new System.Threading.Timer(ConsumerProcess, null, 4000, Timeout.Infinite);

            diskMonitor = new DiskMonitor(downloadMonitor.rootDir, dbHelper.db);
            consumer = new GCActionConsumer(dbHelper.db);
            consumer.rootDir = downloadMonitor.rootDir;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (NotifyIcon icon = new NotifyIcon())
            {
                icon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);
                icon.ContextMenu = new ContextMenu(new MenuItem[] {
                    new MenuItem("About", (s, e) => {new MainForm().Show();}),
                    new MenuItem("Exit", (s, e) => { Application.Exit(); }),
                });
                icon.Visible = true;

                Application.Run();
                icon.Visible = false;
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ConnectsToGC.Setup();
            dbHelper = new DBHelper();

            downloadMonitor         = new DownloadMonitor(dbHelper.db);
            downloadMonitor.rootDir = "C:\\test";
            downloadTimer           = new System.Threading.Timer(DownloadCheck, null, 4000, Timeout.Infinite);
            consumerTimer           = new System.Threading.Timer(ConsumerProcess, null, 4000, Timeout.Infinite);

            diskMonitor      = new DiskMonitor(downloadMonitor.rootDir, dbHelper.db);
            consumer         = new GCActionConsumer(dbHelper.db);
            consumer.rootDir = downloadMonitor.rootDir;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (NotifyIcon icon = new NotifyIcon())
            {
                icon.Icon        = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath);
                icon.ContextMenu = new ContextMenu(new MenuItem[] {
                    new MenuItem("About", (s, e) => { new MainForm().Show(); }),
                    new MenuItem("Exit", (s, e) => { Application.Exit(); }),
                });
                icon.Visible = true;

                Application.Run();
                icon.Visible = false;
            }
        }