Exemplo n.º 1
0
 protected override void OnStart(string[] args)
 {
     m_shutdownEvent = new ManualResetEvent(false);
     m_thread        = new Thread(Run);
     m_thread.Start();
     SystemLogTool.Info("DatAdmin Service started.");
 }
Exemplo n.º 2
0
 protected override void OnStop()
 {
     m_shutdownEvent.Set();
     m_thread.Join(10000);
     //m_thread.Abort();
     base.OnStop();
     SystemLogTool.Info("DatAdmin Service stopped.");
 }
Exemplo n.º 3
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            SystemLogTool.Info("Initializing DatAdmin Service process...");

            try
            {
                var si = new DatAdminServiceInfo();
                si.Load();
                si.Apply();

                Core.IsCommandLine = true;
                Core.Instance.CreateWantedDirs();
                Core.ConfigureLogging();

                FileTextProvider.LoadStdTexts();
                LicenseTool.ReloadLicenses();

                PluginTools.AddMasterAssembly(Assembly.GetAssembly(typeof(Program)));
                PluginTools.LoadPlugins();
                GlobalSettings.Initialize();
                InternetSettings.Initialize();

                FileTextProvider.LoadStdTexts();
                LicenseTool.ReloadLicenses();
                HSettings.CallLoaded();

                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new DatAdminService()
                };
                ServiceBase.Run(ServicesToRun);
            }
            catch (Exception err)
            {
                SystemLogTool.Error("Failed to initialize DatAdmin Service process\n" + err.ToString());
            }
        }