public DataAccess(EventLoggerAccess logger) : base(logger) { _logger = logger; Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); _OpcClient = new OpcClient(configuration.GetSection("opcSection") as OpcSection, ConfigurationManager.AppSettings["TagGroup"], _logger); _OpcClient.OpcTagUpdate += new OpcTagUpdateHandler(_OpcClient_OpcTagUpdate); _OpcClient.Open(); }
/// <summary>Create and prepare a new class instance.</summary> /// <param name="eventLogger"> /// Event Logger specifies a <see cref="EventLoggerAccess"/> instance and must not be /// null...</param> /// <exception cref="ArgumentNullException"> /// If <paramref name="eventLogger"/> specifies null, an exception is thrown.</exception> public DataAccess(EventLoggerAccess eventLogger) : base(eventLogger) { if (/*invalid?*/ eventLogger == null) { throw new ArgumentNullException(ClassName + " EventLoggerAccess reference argument (eventLogger) must not be null"); } Logger = eventLogger; Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); _opcClient = new OpcClient(configuration.GetSection("opcSection") as OpcSection, ConfigurationManager.AppSettings["TagGroup"], Logger); _opcClient.OpcTagUpdate += new OpcTagUpdateHandler(OpcTagUpdate); _opcClient.Open(); }