internal OPCSessionServer(OPCCliConfiguration.ServersRow server, OpcDa::BrowseFilters filters, OPCEnvironment node) : base(server.Name, null, node) { LastEception = null; try { m_Menu = new ContextMenuServer(this); Opc.URL url = new Opc.URL(server.URL); if (server.GetConnectDataRows().Length > 0) { m_ConnectData = server.GetConnectDataRows()[0].GetConnectData(); } m_Spcification = new Opc.Specification() { ID = server.PreferedSpecyficationID, Description = server.PreferedSpecyficationDsc }; Tag = (Server)Factory.GetServerForURL(url, m_Spcification); server.GetOptions(this); foreach (OPCCliConfiguration.SubscriptionsRow rw in server.GetSubscriptionsRows()) { new SubscriptionTreeNodeSession(rw, this); } State = state.disconnectd; } catch (Exception ex) { ReportException(ex); } }
/// <summary> /// Initializes a new instance of the <see cref="OPCServerTreeNodes"/> class with the specified label text. /// </summary> /// <param name="server">The server to add.</param> /// <param name="view">The <see cref="TreeView"/> to add new object..</param> internal OPCSessionServer(Server server, OPCEnvironment node) : base(server.Name, server, node) { m_Menu = new ContextMenuServer(this); m_Spcification = server.PreferedSpecyfication; LastEception = null; if (server.IsConnected) { foreach (Subscription sbscrptn in server.Subscriptions) { new SubscriptionTreeNodeSession(sbscrptn.State, sbscrptn.Items, this); } State = state.connected; } else { State = state.disconnectd; } Expand(); }