Exemplo n.º 1
0
        private static void StartAsApplication()
        {
            SystemHost.StartService();

            var ico = Resources.ServiceIcon;

            ms_TrayIcon = new NotifyIcon
            {
                Text        = @"SCME.NetworkPrinting",
                Icon        = new Icon(ico, ico.Width, ico.Height),
                ContextMenu = new ContextMenu(new[] { new MenuItem(@"Exit", OnExit) }),
                Visible     = true
            };

            Application.ApplicationExit += Application_ApplicationExit;
            Application.Run();
        }
Exemplo n.º 2
0
        protected override void OnStop()
        {
            base.OnStop();

            SystemHost.StopService();
        }
Exemplo n.º 3
0
        protected override void OnStart(string[] Args)
        {
            base.OnStart(Args);

            SystemHost.StartService();
        }
Exemplo n.º 4
0
 private static void CurrentDomainUnhandledException(object Sender, UnhandledExceptionEventArgs E)
 {
     SystemHost.LogCriticalErrorMessage((Exception)E.ExceptionObject);
 }
Exemplo n.º 5
0
 static void Application_ApplicationExit(object Sender, EventArgs E)
 {
     SystemHost.StopService();
 }