public TestNCB(DetectorsDataAccess detectorsDataAccess, BusinessManager businessManager) { InitializeComponent(); AccessBusinessManager = businessManager; AccessDetectorsData = detectorsDataAccess; // disable fake objects FakeObjectCHK.IsChecked = false; FakeObjectUpdate(); CurrentLineIdTextBlk.DataContext = AccessDetectorsData.Detectors; }
public MainWindow() { InitializeComponent(); _eventLoggerAccess = new EventLoggerAccess(); _eventLoggerAccess.LogMessageUpdate += new LogMessageUpdateHandler(LogMessage); _eventLoggerAccess.LogInfo("DetectorsApp Started"); _dataAccess = new DetectorsDataAccess(_eventLoggerAccess); _businessManager = new BusinessManager(_dataAccess, _eventLoggerAccess); _dataAccess.Connect(); CurrentLineIdTextBlk.DataContext = _dataAccess.Detectors; TestAPCS.Content = new TestAPCS(_dataAccess); TestNCB.Content = new TestNCB(_dataAccess, _businessManager); TestAPCS.Visibility = AppConfiguration.ShowDebugDisplays ? Visibility.Visible : Visibility.Collapsed; TestNCB.Visibility = TestAPCS.Visibility; }
public DetectorSimulator(DataAccessDetectors dataAccess, EventLoggerAccess logger, BusinessManager businessManager) { try { InitializeComponent(); _dataAccess = dataAccess; _logger = logger; _businessManager = businessManager; _businessManager.RecordData = false; } catch { throw; } }
private void Window_Closed(object sender, EventArgs eventArguments) { DetectorsApp.TestAPCS.SpeedMsgStop(); try { if (/*exists (avoid first try exceptions)?*/ _businessManager != null) _businessManager.Dispose(); } catch { } finally { _businessManager = null; } try { if (/*exists (avoid first try exceptions)?*/_dataAccess != null) _dataAccess.Dispose(); } catch { } finally { _dataAccess = null; } _eventLoggerAccess.LogWarning(Utilities.ProcessKill(Process.GetCurrentProcess().Id, true)); _eventLoggerAccess = null; }