Esempio n. 1
0
        private static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);


            if (Args.Current.ContainsKey("Interactive"))
            {
                AppServiceThread.Start();
                AppServiceTray.Show();
                Application.Run();
            }
            else if (Args.Current.ContainsKey("Install"))
            {
                ManagedInstallerClass.InstallHelper(new string[] { Assembly.GetExecutingAssembly().Location });
            }
            else if (Args.Current.ContainsKey("Uninstall"))
            {
                ManagedInstallerClass.InstallHelper(new string[] { "/u", Assembly.GetExecutingAssembly().Location });
            }
            else
            {
                ServiceBase.Run(new ServiceBase[] { AppService.Instance });
            }
        }
Esempio n. 2
0
 protected override void OnStop()
 {
     AppServiceThread.Stop();
 }
Esempio n. 3
0
 protected override void OnStart(string[] args)
 {
     AppServiceThread.Start();
 }
Esempio n. 4
0
 private static void mnuExit_Click(object sender, EventArgs e)
 {
     AppServiceThread.Stop();
     TrayIcon.Visible = false;
     Application.Exit();
 }