//////////////////////////////////////////////////////////////////////////////////////////
 public void ClearChildNodesFor(Document.DocumentPart part, string collectionName)
 {
     if (part is Document.AutomatedTest)
     {
         ClearChildNodesTest(part as Document.AutomatedTest, collectionName);
     }
     else if (part is Document.Target)
     {
         ClearChildNodesTarget(part as Document.Target, collectionName);
     }
     else if (part is Document.Project)
     {
         ClearChildNodesProject(part as Document.Project, collectionName);
     }
     else
         throw new ApplicationException("Internal error: Invalid document part type: " + part.GetType().ToString());
 }
 //////////////////////////////////////////////////////////////////////////////////////////
 public void RemoveNodeFor(Document.DocumentPart part)
 {
     if (part is Document.Alert)
     {
         RemoveAlert(part as Document.Alert);
     }
     else if (part is Document.TestParameter)
     {
         RemoveTestParameter(part as Document.TestParameter);
     }
     else if (part is Document.AutomatedTest)
     {
         RemoveTest(part as Document.AutomatedTest);
     }
     else if (part is Document.Target)
     {
         RemoveTarget(part as Document.Target);
     }
     else if (part is Document.Project)
     {
         //RemoveProject(part as Document.Project);
     }
     else
         throw new ApplicationException("Internal error: Invalid document part type: " + part.GetType().ToString());
 }
 public void AddNodeFor(Document.DocumentPart part, bool refreshParent)
 {
     if (part is Document.Alert)
     {
         AddAlert(part as Document.Alert, null, refreshParent);
     }
     else if (part is Document.TestParameter)
     {
         AddTestParameter(part as Document.TestParameter, null, refreshParent);
     }
     else if (part is Document.AutomatedTest)
     {
         AddTest(part as Document.AutomatedTest, null, refreshParent);
     }
     else if (part is Document.Target)
     {
         AddTarget(part as Document.Target, null, refreshParent);
     }
     else if (part is Document.Project)
     {
         AddProject(part as Document.Project);
     }
     else
         throw new ApplicationException("Internal error: Invalid document part type: " + part.GetType().ToString());
 }
        public ContextMenuStrip GetContextMenuFor(Document.DocumentPart part)
        {
            if (part == null) return null;

            if (part is Document.Alert)
            {
                return ctxAlert;
            }
            else if (part is Document.TestParameter)
            {
                return ctxTestParameter;
            }
            else if (part is Document.AutomatedTest)
            {
                return ctxTest;
            }
            else if (part is Document.Target)
            {
                return ctxTarget;
            }
            else if (part is Document.Project)
            {
                return ctxProject;
            }
            else
                throw new ApplicationException("Internal error: Invalid document part type: " + part.GetType().ToString());
        }