Example #1
0
        private static void StartAsApplication()
        {
            SystemHost.StartService();

            var ico = Resources.ServiceIcon;

            ms_TrayIcon = new NotifyIcon
            {
                Text        = @"SCME.DatabaseServer: " + SystemHost.GetHost() + ":" + SystemHost.GetPort().ToString(),
                Icon        = new Icon(ico, ico.Width, ico.Height),
                ContextMenu = new ContextMenu(new[] { new MenuItem(@"Exit", OnExit) }),
                Visible     = true
            };

            Application.ApplicationExit += Application_ApplicationExit;
            Application.Run();
        }
Example #2
0
        protected override void OnStart(string[] Args)
        {
            base.OnStart(Args);

            SystemHost.StartService();
        }