public static bool isComponentParentIsAlsoHisSon(
     SystemComponent parent,
     SystemComponent selectedComponent)
 {
     for (int index1 = 0; index1 < selectedComponent.getFaultsList().Count; ++index1)
     {
         for (int index2 = 0; index2 < selectedComponent.getFaultsList()[index1].getAffectedComponents().Count; ++index2)
         {
             if (parent.getName() == selectedComponent.getFaultsList()[index1].getAffectedComponents()[index2].getName())
             {
                 return(true);
             }
         }
     }
     return(false);
 }
 public static void getAffeectedComponents(
     string selectedComponentName,
     Fault selectedFault,
     List <SystemComponent> affectedComponents)
 {
     for (int index1 = 0; index1 < selectedFault.getAffectedComponents().Count; ++index1)
     {
         SystemComponent affectedComponent = selectedFault.getAffectedComponents()[index1];
         if (affectedComponent.getName() != selectedComponentName && Tools.findComponentInListOfComponents(selectedFault.getAffectedComponents(), selectedComponentName) == null)
         {
             affectedComponents.Add(affectedComponent);
             for (int index2 = 0; index2 < affectedComponent.getFaultsList().Count; ++index2)
             {
                 Tools.getAffeectedComponents(affectedComponent.getName(), affectedComponent.getFaultsList()[index2], affectedComponents);
             }
         }
     }
 }