public ActivityMonitorComponent()
        {
            _connectionState    = new DisconnectedState(this);
            _localServerWatcher = LocalServerWatcher.Instance;

            _textFilterTimer     = new Timer(OnTextFilterTimerElapsed, null, 1000);
            _studyCountWatcher   = new StudyCountWatcher(OnStudyCountChanged);
            _workItemManager     = new WorkItemUpdateManager(_workItems.Items, Include, OnFailureCountChanged);
            _workItemActionModel = new WorkItemActionModel(_workItems.Items, this);
        }
        public override void Initialize()
        {
            base.Initialize();

            // install watchers only once, in the first desktop window (the main window)
            if (!_watchersInstalled)
            {
                _watchersInstalled = true;
                _failureWatcher    = new ActivityMonitorFailureWatcher(this.Context.DesktopWindow, Show);
                _failureWatcher.Initialize();

                _localServerWatcher = LocalServerWatcher.Instance;
                _localServerWatcher.DiskSpaceUsageChanged += LocalServerWatcherOnDiskSpaceUsageChanged;
                CheckDiskspaceUsageExceeded();
            }
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_failureWatcher != null)
         {
             _failureWatcher.Dispose();
             _failureWatcher = null;
         }
         if (_localServerWatcher != null)
         {
             _localServerWatcher.DiskSpaceUsageChanged -= LocalServerWatcherOnDiskSpaceUsageChanged;
             _localServerWatcher = null;
         }
     }
     base.Dispose(disposing);
 }
예제 #4
0
 static LocalServerWatcher()
 {
     Instance = new LocalServerWatcher();
 }