Пример #1
0
        /// <summary>
        /// Add Observer inorder receive Server Shutdown event notification.
        /// </summary>
        /// <param name="observer"></param>
        public void AddObserver(IOPCObserver observer)
        {
            string Function_Name = "AddObserver";

            LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Entered");
            lock (m_opcDataDicObj)
            {
                this.m_observers.Add(observer);
            }
            LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Exited");
        }
Пример #2
0
        /// <summary>
        /// Remove the Observer from its list
        /// </summary>
        /// <param name="observer"></param>
        public void RemoveObserver(IOPCObserver observer)
        {
            string Function_Name = "RemoveObserver";

            LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Entered");
            lock (m_opcDataDicObj)
            {
                try
                {
                    this.m_observers.Remove(observer);
                }
                catch (Exception execption)
                {
                    LogHelper.Error(CLASS_NAME, Function_Name, execption);
                }
            }
            LogHelper.Trace(CLASS_NAME, Function_Name, "Function_Exited");
        }