示例#1
0
 private void PubSubClient_NodePurged(object Sender, NodeNotificationEventArgs e)
 {
     if (this.TryGetChild(e.NodeName, out TreeNode N) && N is PubSubNode Node)
     {
         Node.Purged(e);
     }
 }
示例#2
0
        internal void Purged(NodeNotificationEventArgs _)
        {
            if (this.children is null)
            {
                return;
            }

            TreeNode[] ToRemove;

            lock (this.children)
            {
                ToRemove = new TreeNode[this.children.Count];
                this.children.Values.CopyTo(ToRemove, 0);
                this.children = null;
            }

            MainWindow.UpdateGui(() =>
            {
                foreach (TreeNode Node in ToRemove)
                {
                    Service?.Account?.View?.NodeRemoved(this, Node);
                }

                this.OnUpdated();
            });
        }
示例#3
0
        internal void Purged(NodeNotificationEventArgs e)
        {
            if (this.children is null)
            {
                return;
            }

            TreeNode[] ToRemove;

            lock (this.children)
            {
                ToRemove = new TreeNode[this.children.Count];
                this.children.Values.CopyTo(ToRemove, 0);
                this.children = null;
            }

            MainWindow.currentInstance.Dispatcher.BeginInvoke(new ThreadStart(() =>
            {
                foreach (TreeNode Node in ToRemove)
                {
                    Service?.Account?.View?.NodeRemoved(this, Node);
                }

                this.OnUpdated();
            }));
        }
示例#4
0
        private Task PubSubClient_NodePurged(object Sender, NodeNotificationEventArgs e)
        {
            if (this.TryGetChild(e.NodeName, out TreeNode N) && N is PubSubNode Node)
            {
                Node.Purged(e);
            }

            return(Task.CompletedTask);
        }