Пример #1
0
        /// <summary>
        /// Changes the status and raises the StatusChanged event
        /// </summary>
        /// <param name="newStatus"></param>
        private void ChangeStatus(Statuses newStatus)
        {
            m_status = newStatus;

            if (m_logger.IsDebugEnabled)
            {
                m_logger.Debug("PracticeSharpLogic - Status changed: " + m_status);
            }
            // Raise StatusChanged Event
            if (StatusChanged != null)
            {
                // explicitly invoke each subscribed event handler *asynchronously*
                foreach (StatusChangedEventHandler subscriber in StatusChanged.GetInvocationList())
                {
                    // Event is unidirectional - No call back (i.e. EndInvoke) needed
                    subscriber.BeginInvoke(this, newStatus, null, subscriber);
                }
            }
        }