Пример #1
0
        /// <summary>
        /// Processes a Publish repsonse from the server.
        /// </summary>
        void Session_Notification(Session session, NotificationEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(m_SessionNotification, session, e);
                return;
            }
            else if (!IsHandleCreated)
            {
                return;
            }

            try {
                // ignore notifications for other subscriptions.
                if (!Object.ReferenceEquals(m_subscription, e.Subscription))
                {
                    return;
                }

                // notify controls of the change.
                EventsCTRL.NotificationReceived(e);
                DataChangesCTRL.NotificationReceived(e);

                // update subscription status.
                UpdateStatus();
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Пример #2
0
        /// <summary>
        /// Processes a Publish repsonse from the server.
        /// </summary>
        void MonitoredItem_Notification(MonitoredItem monitoredItem, MonitoredItemNotificationEventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(m_MonitoredItemNotification, monitoredItem, e);
                return;
            }
            else if (!IsHandleCreated)
            {
                return;
            }

            try
            {
                // ignore notifications for other monitored items.
                if (!Object.ReferenceEquals(m_monitoredItem, monitoredItem))
                {
                    return;
                }

                // notify controls of the change.
                EventsCTRL.NotificationReceived(e);
                DataChangesCTRL.NotificationReceived(e);
                LatestValueCTRL.ShowValue(monitoredItem, true);

                // update item status.
                UpdateStatus();
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }