Subversion Repositories DevTools

Rev

Rev 2116 | Rev 2124 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2116 Rev 2122
Line 271... Line 271...
271
      /// notes are empty. It serves to denote a package as a document model that is allowed
271
      /// notes are empty. It serves to denote a package as a document model that is allowed
272
      /// to be processed by this add-in.
272
      /// to be processed by this add-in.
273
      /// </summary>
273
      /// </summary>
274
      /// <param name="parentPackage"></param>
274
      /// <param name="parentPackage"></param>
275
      /// <returns></returns>
275
      /// <returns></returns>
276
      public static bool lookForAndProcess_EA_DocGen_Element( EA.Package parentPackage )
276
      public static EA.Package lookForAndProcess_EA_DocGen_Element( EA.Package pkg )
277
      {
277
      {
278
         options_found  = false;
278
         options_found = false;
279
 
279
 
280
         // Look for an EA_DocGen element in this package
280
         // iterate up through the package hiearchy
281
         foreach(EA.Element theElement in parentPackage.Elements)
281
         while (pkg != null)
282
         {
282
         {
-
 
283
            // Look for an EA_DocGen element in this package
-
 
284
            foreach(EA.Element theElement in pkg.Elements)
-
 
285
            {
283
            options_found = lookForAndProcess_EA_DocGen_Element(theElement);
286
               options_found = lookForAndProcess_EA_DocGen_Element(theElement);
284
            if (options_found)
287
               if (options_found)
-
 
288
               {
-
 
289
                  return pkg;
285
               break;
290
               }
286
         }            
291
            }            
-
 
292
 
-
 
293
            // Didnt find EA_DocGen element, go up one package level ready for the next loop iteration
-
 
294
            if (pkg.ParentID > 0)
-
 
295
            {
-
 
296
               pkg = Main.EA_Repository.GetPackageByID(pkg.ParentID);
-
 
297
            }
-
 
298
            else
-
 
299
            {
-
 
300
               // force loop termination if cannot go up one more package level
-
 
301
               pkg = null;
-
 
302
            }
-
 
303
         }
-
 
304
 
287
         return options_found;
305
         return pkg;
288
      }
306
      }
289
 
307
 
290
      public static bool lookForAndProcess_EA_DocGen_Element( EA.Element theElement )
308
      public static bool lookForAndProcess_EA_DocGen_Element( EA.Element theElement )
291
      {
309
      {
292
         initialise();
310
         initialise();