示例#1
0
        private void OnChildrenChanged(object sender, ScopeNodeCollectionEventArgs e)
        {
            switch (e.ChangeType)
            {
                case ScopeNodeCollectionChangeType.Add:
                    if (this._nodeSyncManager == null)
                    {
                        break;
                    }
                    this._nodeSyncManager.AddNodes(e.GetItems(), e.Index);
                    return;

                case ScopeNodeCollectionChangeType.Remove:
                    if (this._nodeSyncManager != null)
                    {
                        this._nodeSyncManager.RemoveNodes(e.GetItems());
                    }
                    break;

                default:
                    return;
            }
        }
示例#2
0
        internal void OnNodesChanged(object sender, ScopeNodeCollectionEventArgs e)
        {
            ScopeNode[] items = e.GetItems();
            if (items.Length != 0)
            {
                switch (e.ChangeType)
                {
                    case ScopeNodeCollectionChangeType.Add:
                        this.AddNodes(items, e.Index);
                        return;

                    case ScopeNodeCollectionChangeType.Remove:
                        this.RemoveNodes(items);
                        return;
                }
            }
        }