コード例 #1
0
 public void RemoveParent(CollectionOfChild col)
 {
     if (this.Parent != col)
     {
         throw new Exception("Removing parent that isn't the parent");
     }
     this._Parent = null;
 }
コード例 #2
0
 public void UpdateParent(CollectionOfChild col)
 {
     if (col.Contains(this))
     {
         this._Parent = col;
     }
     else
     {
         throw new Exception("Only collection can invoke this");
     }
 }