Пример #1
0
 public RequestManager (DataAccess dataAccess, StatusManager statusManager, EventLoggerAccess logger)
 {
     _Logger = logger;
     _DataAccess = dataAccess;
     _DataAccess.DisplayControlUpdateRequest += new DashboardControlUpdateHandler(ProcessControlUpdateRequest);
     _StatusManager = statusManager;
 }
Пример #2
0
        public MainWindow ()
        {
            InitializeComponent();

            _Logger = new EventLoggerAccess();

            _DataAccess = new DataAccess(_Logger);
            _BusinessManager = new BusinessManager(_DataAccess, _Logger);
        }
Пример #3
0
 /// <summary>Create and prepare a new class instance.</summary>
 /// <param name="dataAccess">
 /// Data Access specifies a <see cref="DataAccess"/> instance and must not be
 /// null...</param>
 /// <param name="eventLogger">
 /// Event Logger specifies a <see cref="EventLoggerAccess"/> instance and must not be
 /// null...</param>
 /// <exception cref="ArgumentNullException">
 /// If either <paramref name="dataAccess"/> or <paramref name="eventLogger"/> specifies
 /// null, an exception is thrown.</exception>
 public BusinessManager(DataAccess dataAccess, EventLoggerAccess eventLogger)
 {
     if (/*invalid?*/ eventLogger == null)
         throw new ArgumentNullException(ClassName + " EventLoggerAccess reference argument (eventLogger) must not be null");
     Logger = eventLogger;
     if (/*invalid?*/ dataAccess == null)
         throw new ArgumentNullException(ClassName + " DataAccess reference argument (dataAccess) must not be null");
     StatusManagerReference = new StatusManager(dataAccess, eventLogger);
     RequestManagerReference = new RequestManager(dataAccess, StatusManagerReference, eventLogger);
 }
Пример #4
0
        public StatusManager (DataAccess dataAccess, EventLoggerAccess logger)
        {
            Logger = logger;
            _Statuses = new StatusElements();
            DataAccess = dataAccess;
            
            _StatusLock = new object();

            ReadTagConfig();

            DataAccess.TagUpdate += new PLCTagUpdateHandler(PLCTagUpdate);
            DataAccess.DisplayUpdateRequest += new DashboardUpdateRequestHandler(DashboardUpdateRequest);
        }
Пример #5
0
 protected virtual void Dispose(bool isDisposing)
 {
     if (/*dispose?*/ isDisposing)
     {
         try
         {   // Disposes SHOULD never throw exceptions ... but...
             if (DataAccessReference != null)
                 DataAccessReference.Dispose();
         }
         catch { }
         finally { DataAccessReference = null; }
         Logger = null;
         Disposed = true;
     }
 }
Пример #6
0
 /// <summary>Create and prepare a new class instance.</summary>
 /// <param name="dataAccess">
 /// Data Access specifies a <see cref="DataAccess"/> instance and must not be
 /// null...</param>
 /// <param name="statusManager">
 /// Stats Manager specifies a <see cref="StatusManager"/> instance and must not be
 /// null...</param>
 /// <param name="eventLogger">
 /// Event Logger specifies a <see cref="EventLoggerAccess"/> instance and must not be
 /// null...</param>
 /// <exception cref="ArgumentNullException">
 /// If either <paramref name="dataAccess"/> or <paramref name="eventLogger"/> specifies
 /// null, an exception is thrown.</exception>
 public RequestManager (DataAccess dataAccess, StatusManager statusManager, EventLoggerAccess eventLogger)
 {
     if (/*invalid?*/ eventLogger == null)
         throw new ArgumentNullException(ClassName + " EventLoggerAccess reference argument (eventLogger) must not be null");
     Logger = eventLogger;
     if (/*invalid?*/ dataAccess == null)
         throw new ArgumentNullException(ClassName + " DataAccess reference argument (dataAccess) must not be null");
     DataAccessReference = dataAccess;
     DataAccessReference.DisplayControlUpdateRequest += new DashboardControlUpdateHandler(ProcessControlUpdateRequest);
     if (/*invalid?*/ statusManager == null)
         throw new ArgumentNullException(ClassName + " StatusManager reference argument (statusManager) must not be null");
     StatusManagerReference = statusManager;
 }
Пример #7
0
 public BusinessManager (DataAccess dataAccess, EventLoggerAccess logger)
 {
     _StatusManager = new StatusManager(dataAccess, logger);
     _RequestManager = new RequestManager(dataAccess, _StatusManager, logger);
 }
Пример #8
0
 public StatusManager(DataAccess dataAccess, EventLoggerAccess eventLogger)
 {
     if (/*invalid?*/ eventLogger == null)
         throw new ArgumentNullException(ClassName + " EventLoggerAccess reference argument (eventLogger) must not be null");
     Logger = eventLogger;
     if (/*invalid?*/ dataAccess == null)
         throw new ArgumentNullException(ClassName + " DataAccess reference argument (dataAccess) must not be null");
     DataAccessReference = dataAccess;
     _statusElements = new StatusElements();
     ReadTagConfig();
     DataAccessReference.OpcTagUpdateHandlers += new PLCTagUpdateHandler(PLCTagUpdate);
     DataAccessReference.DisplayUpdateRequest += new DashboardUpdateRequestHandler(DashboardUpdateRequest);
 }