Example #1
0
 internal static void SDTBasedOnAttDomain(List <KBObject> objs, IOutputService output)
 {
     foreach (KBObject obj in objs)
     {
         if (obj is SDT)
         {
             SDTStructurePart sdtstruct         = obj.Parts.Get <SDTStructurePart>();
             bool             hasItemNotBasedOn = false;
             string           itemnames         = "";
             foreach (IStructureItem structItem in sdtstruct.Root.Items)
             {
                 if (structItem is SDTItem)
                 {
                     SDTItem sdtItem = (SDTItem)structItem;
                     if (sdtItem.BasedOn == null && sdtItem.AttributeBasedOn == null && Utility.TypeHasToBeInDomain(sdtItem.Type))
                     {
                         hasItemNotBasedOn = true;
                         itemnames        += sdtItem.Name + " ";
                     }
                 }
             }
             if (hasItemNotBasedOn)
             {
                 OutputError err = new OutputError("SDT with items without domain: " + itemnames, MessageLevel.Warning, new KBObjectAnyPosition(obj));
                 output.Add("KBDoctor", err);
             }
         }
     }
 }