Esempio n. 1
0
 public void LinkParent(ILinkedTreeElement parent)
 {
     if (this.parent != null)
     {
         this.parent = parent;
     }
     else
     {
         throw new InvalidOperationException("Parent already set");
     }
 }
Esempio n. 2
0
 public void LinkChild(ILinkedTreeElement child)
 {
     if (!targetResources.Contains(child))
     {
         targetResources.Add((TargetResource)child);
     }
     else
     {
         throw new ArgumentException("already exists", "child");
     }
 }
Esempio n. 3
0
        public void UnlinkChild(ILinkedTreeElement child)
        {
            if (targetResources.Contains(child))
            {
                targetResources.Remove((TargetResource)child);
            }
            else
            {
                throw new ArgumentException("Not found", "child");
            }

            throw new NotImplementedException();
        }
Esempio n. 4
0
 public ILinkedTreeElement UnlinkParent()
 {
     if (parent != null)
     {
         var p = parent;
         parent = null;
         return p;
     }
     else
     {
         throw new InvalidOperationException("Parent is not null");
     }
 }