Beispiel #1
0
 private void ChildrenList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Add)
     {
         int newStartingIndex = e.NewStartingIndex;
         foreach (object newItem in (IEnumerable)e.NewItems)
         {
             NodeObject nodeObject1 = newItem as NodeObject;
             this.GetCSVisual().InsertChild(newStartingIndex, nodeObject1.GetCSVisual());
             ++newStartingIndex;
             nodeObject1.BindingRecorder((string)null);
             nodeObject1.AncestorObjectChanged((BaseObject)nodeObject1, NotifyCollectionChangedAction.Add);
             nodeObject1.IsHitTestVisible = false;
             NodeObject nodeObject2   = nodeObject1;
             int        operationFlag = (int)nodeObject2.OperationFlag;
             int        num           = 0;
             nodeObject2.OperationFlag = (OperationMask)num;
         }
     }
     else
     {
         if (e.Action != NotifyCollectionChangedAction.Remove)
         {
             return;
         }
         foreach (object oldItem in (IEnumerable)e.OldItems)
         {
             NodeObject nodeObject = oldItem as NodeObject;
             nodeObject.AncestorObjectChanged((BaseObject)nodeObject, NotifyCollectionChangedAction.Remove);
             this.GetCSVisual().RemoveChild(nodeObject.GetCSVisual());
         }
     }
 }
Beispiel #2
0
 private void ChildrenList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Add)
     {
         int num = e.NewStartingIndex;
         foreach (object current in e.NewItems)
         {
             NodeObject nodeObject = current as NodeObject;
             this.GetCSVisual().InsertChild(num, nodeObject.GetCSVisual());
             num++;
             nodeObject.BindingRecorder(null);
             nodeObject.AncestorObjectChanged(nodeObject, NotifyCollectionChangedAction.Add);
             nodeObject.IsHitTestVisible = false;
             NodeObject    expr_6D  = nodeObject;
             OperationMask arg_73_0 = expr_6D.OperationFlag;
             expr_6D.OperationFlag = OperationMask.NoneFlag;
         }
     }
     else if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         foreach (object current in e.OldItems)
         {
             NodeObject nodeObject = current as NodeObject;
             nodeObject.AncestorObjectChanged(nodeObject, NotifyCollectionChangedAction.Remove);
             this.GetCSVisual().RemoveChild(nodeObject.GetCSVisual());
         }
     }
 }