public void Update(Interfaces.IReference reference) { NodeInfoList.Clear(); var nodeInfoList = client.GetNodeInfoList(reference.NodeId); if (nodeInfoList == null) { return; } foreach (var nodeinfo in nodeInfoList) { NodeInfoList.Add(nodeinfo); } }
private void UpdateVariableNodes(Interfaces.IReference obj) { try { var client = connector as Client; var refs = client.FetchVariableReferences(obj.NodeId); if (refs != null && refs.Count != 0) { VariableNodes = refs; } } catch (Exception ex) { this.EventAggregator .GetEvent <Events.ErrorNotificationEvent>() .Publish(new Events.ErrorNotification(ex)); Initialize(); } }
public NodeTreeModel( Interfaces.IConnection connector, Interfaces.IReference references, Interfaces.ISubscriptionModel subscriptionM, Interfaces.IOneTimeAccessModel oneTimeAccessM) { this.connector = connector; this.references = references; ReloadCommand = new Commands.DelegateCommand( (param) => { ForceUpdate(); }, (param) => connector.Connected); MouseDoubleClickedCommand = new DelegateCommand <IList>((items) => { subscriptionM.AddToSubscription(items); ChangeSelectedIndexForTabContorol(0); }, (param) => true); AddToReadWriteCommand = new Commands.DelegateCommand( (param) => { oneTimeAccessM.AddToReadWrite((IList)param); ChangeSelectedIndexForTabContorol(1); }, (param) => connector.Connected); NodeSelectedCommand = new Commands.DelegateCommand( (param) => { }, //nodeInfoDataGrid.Update((VariableNode)param); }, (param) => true); UpdateVariableNodeListCommand = new Commands.DelegateCommand( (param) => { UpdateVariableNodes((Interfaces.IReference)param); }, (param) => true); this.connector.ObserveProperty(x => x.Connected).Subscribe(c => Update(c)); Initialize(); }
private void SelectionChanged(Interfaces.IReference reference, Interfaces.INodeInfoDataGrid nodeInfoDataGrid) { nodeInfoDataGrid.Update(reference); }