Ejemplo n.º 1
0
        private void ThreadManager_ThreadForcedToClose(object sender, ThreadManagerEventArgs e)
        {
            Shared.EventLog.Add(String.Format("Thread forced to close: {0}, Unresponsive: {1}, Marked For Removal: {2}",
                                              e.Thread.Name, e.Thread.UnResponsive.ToString(), e.Thread.MarkedForRemoval.ToString()));
            Shared.EventLog.Add(String.Format("Start Time: {0}", e.Thread.TimeStart.ToString("g")));
            Shared.EventLog.Add(String.Format("End Time: {0}", e.Thread.TimeFinish.ToString("g")));

            if (!Program.Closing)
            {
                if (e.Thread.Name == Constants.Service.ThreadLocalDataMonitoring)
                {
                    _serviceDataThread = new LocalServiceDataThread();
                    _serviceDataThread.OnNewServerDetails += ServerDataThread_OnNewServerDetails;

                    _serviceDataThread.MonitorDisks   = _serviceSettings.Find(Constants.Settings.MonitorDisks).GetValue <bool>();
                    _serviceDataThread.MonitorNetwork = _serviceSettings.Find(Constants.Settings.MonitorNetworks).GetValue <bool>();

                    ThreadManager.ThreadStart(_serviceDataThread,
                                              Constants.Service.ThreadLocalDataMonitoring,
                                              System.Threading.ThreadPriority.BelowNormal);
                }
            }
        }
Ejemplo n.º 2
0
        public PrimaryService()
        {
            MessageServerLogin = true;

            InitializeComponent();
            LoadServiceSettings();
            LoadEmailSettings();

            _serviceDataThread = new LocalServiceDataThread();
            _serviceDataThread.OnNewServerDetails += ServerDataThread_OnNewServerDetails;

            _serviceDataThread.MonitorDisks   = _serviceSettings.Find(Constants.Settings.MonitorDisks).GetValue <bool>();
            _serviceDataThread.MonitorNetwork = _serviceSettings.Find(Constants.Settings.MonitorNetworks).GetValue <bool>();

            ThreadManager.ThreadStart(_serviceDataThread,
                                      Constants.Service.ThreadLocalDataMonitoring,
                                      System.Threading.ThreadPriority.Lowest);

            _notifyRunAsApp.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
            _pluginManager       = new PluginManager(this, this, this, this);
            _pluginManager.LoadServices();

            ProcessParams.PostProcessAllParams(_pluginManager);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns dynamic server data
 /// </summary>
 /// <returns></returns>
 private string GetDynamicServerData()
 {
     return(JsonConvert.SerializeObject(LocalServiceDataThread.GetAllItems()));
 }