StopMonitoring() public method

Stops monitoring the item.
public StopMonitoring ( ISampledDataChangeMonitoredItem monitoredItem ) : bool
monitoredItem ISampledDataChangeMonitoredItem
return bool
Ejemplo n.º 1
0
        /// <summary>
        /// Stops monitoring the item.
        /// </summary>
        /// <remarks>
        /// It will call the external source to stop the monitoring if an external source was provided originally.
        /// The changes will not take affect until the ApplyChanges() method is called.
        /// </remarks>
        public virtual void StopMonitoring(ISampledDataChangeMonitoredItem monitoredItem)
        {
            lock (m_lock) {
                // check for sampling group.
                SamplingGroup samplingGroup = null;

                if (m_sampledItems.TryGetValue(monitoredItem, out samplingGroup))
                {
                    if (samplingGroup != null)
                    {
                        samplingGroup.StopMonitoring(monitoredItem);
                    }

                    m_sampledItems.Remove(monitoredItem);
                    return;
                }
            }
        }