Пример #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            // Local Variables
            bool bIsService = IsService();

            // Are we a genuine service?
            if (bIsService)
            {
                // Run the service
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new MainService()
                };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                // Turn on visual styling
                Application.EnableVisualStyles();

                // Run in interactive mode...
                DnsCymbalUpdater dcu = new DnsCymbalUpdater();
                dcu.Start();

                TrayIcon ti = new TrayIcon(dcu);
                ti.ShowDialog();
            }
        }
Пример #2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            // Local Variables
            bool bIsService = IsService();

            // Are we a genuine service?
            if (bIsService)
            {
                // Run the service
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new MainService()
                };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                // Turn on visual styling
                Application.EnableVisualStyles();

                // Run in interactive mode...
                DnsCymbalUpdater dcu = new DnsCymbalUpdater();
                dcu.Start();

                TrayIcon ti = new TrayIcon(dcu);
                ti.ShowDialog();
            }
        }