コード例 #1
0
ファイル: TestNCB.xaml.cs プロジェクト: BdGL3/CXPortal
        public TestNCB(DetectorsDataAccess detectorsDataAccess, BusinessManager businessManager)
        {
            InitializeComponent();

            AccessBusinessManager = businessManager;
            AccessDetectorsData = detectorsDataAccess;

            // disable fake objects
            FakeObjectCHK.IsChecked = false;
            FakeObjectUpdate();

            CurrentLineIdTextBlk.DataContext = AccessDetectorsData.Detectors;
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: BdGL3/CXPortal
 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;
 }
コード例 #3
0
        public DetectorSimulator(DataAccessDetectors dataAccess, EventLoggerAccess logger, BusinessManager businessManager)
        {
            try
            {
                InitializeComponent();

                _dataAccess = dataAccess;
                _logger = logger;
                _businessManager = businessManager;
                _businessManager.RecordData = false;
            }
            catch
            {
                throw;
            }
        }            
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: BdGL3/CXPortal
 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;
 }