예제 #1
0
 public ConfigurationHost()
 {
     _sessionManager = new SessionManager();
     ManagementHost.RegisterCompactTypes();
     _configurationServer = new ConfigurationServer();
     Initialize();
     _sessionManager.ConfigServer = _configurationServer;
 }
예제 #2
0
        protected override void OnStart(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            try
            {
                _host = new ManagementHost();
                _host.Initialize();
                _host.Start();

                Thread thread = new Thread(() => startDb());
                thread.Start();

                // _host.StartDbNodes();
                //try
                //{
                //
                //}
                //catch (Exception e)
                //{
                //    _host.StartLocalDbNode();
                //}
                //bool start = false;
                //do
                //{
                //    start = _host.StartLocalDbNode();


                //} while (!start);


                //if (Licensing.LicenseManager.LicenseMode(null) == Licensing.LicenseManager.LicenseType.InEvaluation)
                //{
                //    _evalWarningTask = new System.Timers.Timer();
                //    _evalWarningTask.Interval = 1000 * 60 * 60 * 12;// 12 hour interval.
                //    _evalWarningTask.Elapsed += new ElapsedEventHandler(NotifyEvalLicense);
                //    _evalWarningTask.Enabled = true;
                //    NotifyEvalLicense(null, null);
                //}
                //if (Alachisoft.NosDB.Core.Licensing.LicenseManager.Reactivate)
                //{
                //    _reactWarningTask = new System.Timers.Timer();
                //    _reactWarningTask.Interval = 1000 * 60 * 60 * 24;//1 day
                //    _reactWarningTask.Elapsed += new ElapsedEventHandler(NotifyReactivateLicense);
                //    _reactWarningTask.Enabled = true;
                //    NotifyReactivateLicense(null, null);
                //}
                //AppUtil.LogEvent("Database Service started successfully11", EventLogEntryType.Information);
            }
            catch (Exception ex)
            {
                //writer.WriteLine("Exception:::" + ex.ToString() + "\n InnerException" + ex.InnerException);
                AppUtil.LogEvent(AppUtil.EventLogSource, ex.ToString(), EventLogEntryType.Error, EventCategories.Error, EventID.GeneralError);
                throw ex;
            }
        }