private void Add(string Type) { string FullJid = this.Concentrator?.FullJid; ConcentratorClient ConcentratorClient = this.ConcentratorClient; if (ConcentratorClient != null && !string.IsNullOrEmpty(FullJid)) { Mouse.OverrideCursor = Cursors.Wait; ConcentratorClient.GetParametersForNewNode(FullJid, this.nodeInfo, Type, "en", string.Empty, string.Empty, string.Empty, (sender, Form) => { MainWindow.MouseDefault(); MainWindow.UpdateGui(() => { ParameterDialog Dialog = new ParameterDialog(Form); Dialog.ShowDialog(); }); return(Task.CompletedTask); }, (sender, e) => { if (e.Ok) { this.Add(new Node(this, e.NodeInformation)); } return(Task.CompletedTask); }, null); } }
private void Add(string Type) { string FullJid = this.Concentrator?.FullJid; ConcentratorClient ConcentratorClient = this.ConcentratorClient; if (ConcentratorClient != null && !string.IsNullOrEmpty(FullJid)) { Mouse.OverrideCursor = Cursors.Wait; ConcentratorClient.GetParametersForNewNode(FullJid, this.nodeInfo, Type, "en", string.Empty, string.Empty, string.Empty, (sender, Form) => { MainWindow.MouseDefault(); MainWindow.currentInstance.Dispatcher.BeginInvoke(new ThreadStart(() => { ParameterDialog Dialog = new ParameterDialog(Form); Dialog.ShowDialog(); })); }, (sender, e) => { if (e.Ok) { this.Add(new Node(this, e.NodeInformation)); } }, null); } }
private void Add(string Type) { string FullJid = this.Concentrator?.FullJid; ConcentratorClient ConcentratorClient = this.ConcentratorClient; if (ConcentratorClient != null && !string.IsNullOrEmpty(FullJid)) { Mouse.OverrideCursor = Cursors.Wait; ConcentratorClient.GetParametersForNewNode(FullJid, this.nodeInfo, Type, "en", string.Empty, string.Empty, string.Empty, (sender, Form) => { MainWindow.MouseDefault(); MainWindow.currentInstance.Dispatcher.BeginInvoke(new ThreadStart(() => { ParameterDialog Dialog = new ParameterDialog(Form); Dialog.ShowDialog(); })); }, (sender, e) => { if (e.Ok) { if (!this.loadingChildren && (this.children == null || this.children.Count != 1 || !this.children.ContainsKey(string.Empty))) { SortedDictionary <string, TreeNode> Children = new SortedDictionary <string, TreeNode>(); if (this.children != null) { foreach (KeyValuePair <string, TreeNode> P in this.children) { Children[P.Key] = P.Value; } } Children[e.NodeInformation.NodeId] = new Node(this, e.NodeInformation); this.children = Children; this.OnUpdated(); this.Concentrator?.NodesAdded(Children.Values, this); } } }, null); } }