Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2169 ghuddy 1
using System;
2
using System.Collections;
3
 
4
namespace EA_ReqPro
5
{
6
	/// <summary>
7
   /// This class is one derived from the EA_RecursionWorker base class so that
8
   /// an instance of it can be used as a parameter in the EA_Utilities.findAndProcessPackageElements
9
   /// method which recursively parses a given package. Thus, clients can parse EA model structure but
10
   /// specify their own functionality to be carried out on packages and elements found in the
11
   /// parsing.
12
   /// This particular derived class is designed to collect a list of element names from the
13
   /// package, from elements that have a type that is acceptable.
14
	/// </summary>
15
   public class EA_ElementAccumulator : EA_RecursionWorker
16
   {
17
      public ArrayList Elements = null;
18
      public ArrayList ElementIDs = null;
19
      private ArrayList validElementTypes = null;
20
 
21
      public EA_ElementAccumulator(ArrayList elementTypeList): base()
22
      {
23
         validElementTypes = elementTypeList;
24
         Elements = new ArrayList();
25
         ElementIDs = new ArrayList();
26
      }
27
 
28
      public override void processElement( EA.Element theElement )
29
      {
30
         if (validElementTypes.Contains( theElement.Type ))
31
         {
32
            Elements.Add( theElement );
33
            ElementIDs.Add( theElement.ElementID );
34
         }
35
      }
36
   }
37
}