ReportEvent() public méthode

Reports an event produced by the object.
public ReportEvent ( BaseEvent e ) : void
e BaseEvent
Résultat void
Exemple #1
0
        /// <summary>
        /// Reports an event produced by the object.
        /// </summary>
        public virtual void ReportEvent(BaseEvent e)
        {
            lock (DataLock)
            {
                if (m_reportEventsToParent)
                {
                    ObjectSource parent = Parent as ObjectSource;

                    if (parent != null)
                    {
                        parent.ReportEvent(e);
                    }
                }

                List <IEventMonitoredItem> monitoredItems = new List <IEventMonitoredItem>();

                if (MonitoredItems != null)
                {
                    foreach (IMonitoredItem monitoredItem in MonitoredItems)
                    {
                        IEventMonitoredItem eventItem = monitoredItem as IEventMonitoredItem;

                        if (eventItem != null)
                        {
                            monitoredItems.Add(eventItem);
                        }
                    }

                    if (monitoredItems.Count > 0)
                    {
                        EventManager.ReportEvent(e, monitoredItems);
                    }
                }
            }
        }