/// <summary> /// Processes a change to the subscription. /// </summary> public void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { if ((e.Status & SubscriptionChangeMask.ItemsDeleted) != 0) { // collect events for items that have been deleted. List <ListViewItem> itemsToRemove = new List <ListViewItem>(); foreach (ListViewItem listItem in ItemsLV.Items) { EventFieldList eventFields = listItem.Tag as EventFieldList; if (eventFields != null) { if (m_subscription.FindItemByClientHandle(eventFields.ClientHandle) == null) { itemsToRemove.Add(listItem); } } } // remove events for items that have been deleted. foreach (ListViewItem listItem in itemsToRemove) { listItem.Remove(); } } }
/// <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); } }
private void OnStateChangedHandler(object sender, SubscriptionStateChangedEventArgs e) { var sub = sender as Subscription; if (e.Status == SubscriptionChangeMask.Deleted) { Console.WriteLine("Suscription Deleted SEND!"); MessagingCenter.Send <ClientOPC>(this, "SubDelete"); } }
/// <summary> /// Handles a change to the state of the subscription. /// </summary> void Subscription_StateChanged(Subscription subscription, SubscriptionStateChangedEventArgs e) { 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(String.Empty, GuiUtils.CallerName(), exception); } }
/// <summary> /// Called when the subscription changes. /// </summary> public void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { UpdateItems(); // close any monitoring windows. if ((e.Status | SubscriptionChangeMask.ItemsDeleted) != 0) { List <MonitoredItemDlg> dialogsToClose = new List <MonitoredItemDlg>(); foreach (KeyValuePair <uint, MonitoredItemDlg> current in m_dialogs) { if (m_subscription.FindItemByClientHandle(current.Key) == null) { dialogsToClose.Add(current.Value); } } // this invokes a callback which will remove the dialog from the table. foreach (MonitoredItemDlg dialog in dialogsToClose) { dialog.Close(); } } }
/// <summary> /// Called when the subscription changes. /// </summary> public void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { UpdateItems(); }
internal void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { throw new NotImplementedException(); }
/// <summary> /// Handles a change to the state of the subscription. /// </summary> void Subscription_StateChanged(Subscription subscription, SubscriptionStateChangedEventArgs e) { 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(String.Empty, GuiUtils.CallerName(), exception); } }
internal void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { throw new NotImplementedException(); }
/// <summary> /// Called when the subscription changes. /// </summary> public void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { UpdateItems(); }
/// <summary> /// Processes a change to the subscription. /// </summary> public void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { if ((e.Status & SubscriptionChangeMask.ItemsDeleted) != 0) { // collect events for items that have been deleted. List<ListViewItem> itemsToRemove = new List<ListViewItem>(); foreach (ListViewItem listItem in ItemsLV.Items) { EventFieldList eventFields = listItem.Tag as EventFieldList; if (eventFields != null) { if (m_subscription.FindItemByClientHandle(eventFields.ClientHandle) == null) { itemsToRemove.Add(listItem); } } } // remove events for items that have been deleted. foreach (ListViewItem listItem in itemsToRemove) { listItem.Remove(); } } }
/// <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); } }
/// <summary> /// Called when the subscription changes. /// </summary> public void SubscriptionChanged(SubscriptionStateChangedEventArgs e) { UpdateItems(); // close any monitoring windows. if ((e.Status | SubscriptionChangeMask.ItemsDeleted) != 0) { List<MonitoredItemDlg> dialogsToClose = new List<MonitoredItemDlg>(); foreach (KeyValuePair<uint,MonitoredItemDlg> current in m_dialogs) { if (m_subscription.FindItemByClientHandle(current.Key) == null) { dialogsToClose.Add(current.Value); } } // this invokes a callback which will remove the dialog from the table. foreach (MonitoredItemDlg dialog in dialogsToClose) { dialog.Close(); } } }