private void StandardClient_Server_ReconnectComplete(object sender, EventArgs e) { if (InvokeRequired) { BeginInvoke(new EventHandler(StandardClient_Server_ReconnectComplete), sender, e); return; } try { // ignore callbacks from discarded objects. if (!Object.ReferenceEquals(sender, m_reconnectHandler)) { return; } m_session = m_reconnectHandler.Session; m_reconnectHandler.Dispose(); m_reconnectHandler = null; BrowseCTRL.SetView(m_session, BrowseViewType.Objects, null); SessionsCTRL.Reload(m_session); StandardClient_KeepAlive(m_session, null); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }
/// <summary> /// Displays the dialog. /// </summary> public EventFilter ShowDialog(Session session, EventFilter filter, bool editWhereClause) { if (session == null) { throw new ArgumentNullException("session"); } if (filter == null) { throw new ArgumentNullException("filter"); } m_session = session; m_filter = filter; BrowseCTRL.SetView(m_session, BrowseViewType.EventTypes, null); SelectClauseCTRL.Initialize(session, filter.SelectClauses); ContentFilterCTRL.Initialize(session, filter.WhereClause); FilterOperandsCTRL.Initialize(session, null, -1); MoveBTN_Click((editWhereClause)?NextBTN:BackBTN, null); if (ShowDialog() != DialogResult.OK) { return(null); } return(m_filter); }
/// <summary> /// Displays the dialog. /// </summary> public void Show(Subscription subscription, bool useTypeModel) { if (subscription == null) { throw new ArgumentNullException("subscription"); } Show(); BringToFront(); // remove previous subscription. if (m_subscription != null) { m_subscription.StateChanged -= m_SubscriptionStateChanged; } // start receiving notifications from the new subscription. m_subscription = subscription; if (subscription != null) { m_subscription.StateChanged += m_SubscriptionStateChanged; } m_subscription = subscription; BrowseCTRL.AllowPick = true; BrowseCTRL.SetView(subscription.Session, (useTypeModel)?BrowseViewType.ObjectTypes:BrowseViewType.Objects, null); MonitoredItemsCTRL.Initialize(subscription); }
/// <summary> /// Displays the dialog. /// </summary> public void Show(Session session, ReadValueIdCollection valueIds) { if (session == null) { throw new ArgumentNullException("session"); } m_session = session; BrowseCTRL.SetView(m_session, BrowseViewType.Objects, null); ReadValuesCTRL.Initialize(session, valueIds); MoveBTN_Click(BackBTN, null); Show(); BringToFront(); }
/// <summary> /// Displays the address space with the specified view /// </summary> public void Show(Session session, BrowseViewType viewType, NodeId viewId) { if (session == null) { throw new ArgumentNullException("session"); } if (m_session != null) { m_session.SessionClosing -= m_SessionClosing; } m_session = session; m_session.SessionClosing += m_SessionClosing; BrowseCTRL.SetView(session, viewType, viewId); }
/// <summary> /// Connects to a server. /// </summary> public void Connect(ConfiguredEndpoint endpoint) { if (endpoint == null) { return; } Session session = SessionsCTRL.Connect(endpoint); if (session != null) { m_session = session; m_session.KeepAlive += new KeepAliveEventHandler(StandardClient_KeepAlive); BrowseCTRL.SetView(m_session, BrowseViewType.Objects, null); StandardClient_KeepAlive(m_session, null); } }
/// <summary> /// Displays the dialog. /// </summary> public NodeIdCollection ShowDialog( Session session, BrowseViewType browseView, NodeIdCollection nodesIds, NodeClass nodeClassMask) { if (session == null) { throw new ArgumentNullException("session"); } m_session = session; BrowseCTRL.SetView(session, browseView, null); NodeListCTRL.Initialize(session, nodesIds, nodeClassMask); if (ShowDialog() != DialogResult.OK) { return(null); } return(NodeListCTRL.GetNodeIds()); }
/// <summary> /// Connects to a server. /// </summary> public async void Connect(ConfiguredEndpoint endpoint) { if (endpoint == null) { return; } Session session = await SessionsCTRL.Connect(endpoint); if (session != null) { // stop any reconnect operation. if (m_reconnectHandler != null) { m_reconnectHandler.Dispose(); m_reconnectHandler = null; } m_session = session; m_session.KeepAlive += new KeepAliveEventHandler(StandardClient_KeepAlive); BrowseCTRL.SetView(m_session, BrowseViewType.Objects, null); StandardClient_KeepAlive(m_session, null); } }