/// <summary> /// Handles a change to the state of the subscription. /// </summary> void Subscription_StateChanged(Subscription subscription, SubscriptionStateChangedEventArgs e) { if (InvokeRequired) { BeginInvoke(m_SubscriptionStateChanged, subscription, e); return; } else if (!IsHandleCreated) { return; } try { // ignore notifications for other subscriptions. if (!Object.ReferenceEquals(m_subscription, subscription)) { return; } // notify controls of the change. EventsCTRL.SubscriptionChanged(e); DataChangesCTRL.SubscriptionChanged(e); MonitoredItemsCTRL.SubscriptionChanged(e); // update subscription status. UpdateStatus(); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }