Пример #1
0
 public void Move(DmSuperTyp targetSuperTyp)
 {
     if (Parent != null)
     {
         Parent.Childs.Remove(this);
     }
     targetSuperTyp.Childs.Add(this);
     GroupId = targetSuperTyp.SuperTypId;
 }
Пример #2
0
        public void RetrieveChilds()
        {
            var superTypes = Queries.ChildList(SuperTypId);

            foreach (var superType in superTypes)
            {
                if (!this.Childs.Any(p => p.SuperTypId == superType.SUPER_TYP_ID))
                {
                    DmSuperTyp child = superType;
                    child.Parent = this;
                    Childs.Add(child);
                }
            }
        }
Пример #3
0
 private void OnChildsChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     // Note: This section does not account for multiple items being involved in change operations.
     // Note: This section does not account for the replace operation.
     if (e.Action == NotifyCollectionChangedAction.Add)
     {
         DmSuperTyp superTyp = (DmSuperTyp)e.NewItems[0];
         superTyp.Parent = this;
     }
     else if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         DmSuperTyp superTyp = (DmSuperTyp)e.OldItems[0];
         if (superTyp.Parent == this)
         {
             superTyp.Parent = null;
         }
     }
 }