| Line 1... |
Line 1... |
| 1 |
|
1 |
|
| 2 |
using System;
|
2 |
using System;
|
| - |
|
3 |
using System.Text;
|
| - |
|
4 |
using System.Globalization;
|
| - |
|
5 |
using System.Collections;
|
| - |
|
6 |
using System.Windows.Forms;
|
| - |
|
7 |
using ReqPro40;
|
| 3 |
|
8 |
|
| 4 |
namespace EA_ReqPro
|
9 |
namespace EA_ReqPro
|
| 5 |
{
|
10 |
{
|
| 6 |
/// <summary>
|
11 |
/// <summary>
|
| 7 |
/// Summary description for EA_Utils.
|
12 |
/// Summary description for EA_Utils.
|
| Line 85... |
Line 90... |
| 85 |
}
|
90 |
}
|
| 86 |
return result;
|
91 |
return result;
|
| 87 |
}
|
92 |
}
|
| 88 |
|
93 |
|
| 89 |
|
94 |
|
| - |
|
95 |
/// <summary>
|
| - |
|
96 |
/// Creates a package under the specified parent package. the package is given a tree position
|
| - |
|
97 |
/// as specified in order for it to be ordered in the model as the caller requires.
|
| - |
|
98 |
/// </summary>
|
| - |
|
99 |
/// <param name="parentPackage"></param>
|
| - |
|
100 |
/// <param name="name"></param>
|
| - |
|
101 |
/// <param name="treePos"></param>
|
| - |
|
102 |
/// <returns></returns>
|
| - |
|
103 |
public EA.Package createPackage(EA.Package parentPackage, string name, int treePos)
|
| - |
|
104 |
{
|
| - |
|
105 |
EA.Package newobj = (EA.Package)parentPackage.Packages.AddNew(name, "Package");
|
| - |
|
106 |
newobj.TreePos = treePos;
|
| - |
|
107 |
newobj.Update();
|
| - |
|
108 |
return newobj;
|
| - |
|
109 |
}
|
| - |
|
110 |
|
| - |
|
111 |
public void DumpEAElement(EA.Repository repository)
|
| - |
|
112 |
{
|
| - |
|
113 |
EA.Element ea_ele = (EA.Element)repository.GetTreeSelectedObject();
|
| - |
|
114 |
|
| - |
|
115 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "EA Element : " + ea_ele.Name, ea_ele.ElementID);
|
| - |
|
116 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Author : " + ea_ele.Author, -1);
|
| - |
|
117 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "ClassfierID : " + ea_ele.ClassfierID.ToString(), -1);
|
| - |
|
118 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "ClassifierName : " + ea_ele.ClassifierName, -1);
|
| - |
|
119 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "ClassifierType : " + ea_ele.ClassifierType, -1);
|
| - |
|
120 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Complexity : " + ea_ele.Complexity, -1);
|
| - |
|
121 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Difficulty : " + ea_ele.Difficulty, -1);
|
| - |
|
122 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "ElementGUID : " + ea_ele.ElementGUID, -1);
|
| - |
|
123 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "ElementID : " + ea_ele.ElementID.ToString(), ea_ele.ElementID);
|
| - |
|
124 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "EventFlags : " + ea_ele.EventFlags, -1);
|
| - |
|
125 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "ExtensionPoints : " + ea_ele.ExtensionPoints, -1);
|
| - |
|
126 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Genfile : " + ea_ele.Genfile, -1);
|
| - |
|
127 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Genlinks : " + ea_ele.Genlinks, -1);
|
| - |
|
128 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Gentype : " + ea_ele.Gentype, -1);
|
| - |
|
129 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "GetLastError : " + ea_ele.GetLastError(), -1);
|
| - |
|
130 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "GetLinkedDocument : " + ea_ele.GetLinkedDocument(), -1);
|
| - |
|
131 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "GetStereotypeList : " + ea_ele.GetStereotypeList(), -1);
|
| - |
|
132 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "MetaType : " + ea_ele.MetaType, -1);
|
| - |
|
133 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Multiplicity : " + ea_ele.Multiplicity, -1);
|
| - |
|
134 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Notes : " + ea_ele.Notes, -1);
|
| - |
|
135 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "PackageID : " + ea_ele.PackageID.ToString(), ea_ele.PackageID);
|
| - |
|
136 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "ParentID : " + ea_ele.ParentID.ToString(), ea_ele.ParentID);
|
| - |
|
137 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Persistence : " + ea_ele.Persistence, -1);
|
| - |
|
138 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Phase : " + ea_ele.Phase, -1);
|
| - |
|
139 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Priority : " + ea_ele.Priority, -1);
|
| - |
|
140 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "PropertyType : " + ea_ele.PropertyType.ToString(), -1);
|
| - |
|
141 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "RunState : " + ea_ele.RunState, -1);
|
| - |
|
142 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Status : " + ea_ele.Status, -1);
|
| - |
|
143 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Stereotype : " + ea_ele.Stereotype, -1);
|
| - |
|
144 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "StereotypeEx : " + ea_ele.StereotypeEx, -1);
|
| - |
|
145 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "StyleEx : " + ea_ele.StyleEx, -1);
|
| - |
|
146 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Subtype : " + ea_ele.Subtype.ToString(), -1);
|
| - |
|
147 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Tablespace : " + ea_ele.Tablespace, -1);
|
| - |
|
148 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Tag : " + ea_ele.Tag, -1);
|
| - |
|
149 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "TreePos : " + ea_ele.TreePos.ToString(), -1);
|
| - |
|
150 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Type : " + ea_ele.Type, -1);
|
| - |
|
151 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Version : " + ea_ele.Version, -1);
|
| - |
|
152 |
repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "Visibility : " + ea_ele.Visibility, -1);
|
| - |
|
153 |
}
|
| - |
|
154 |
|
| - |
|
155 |
|
| 90 |
}
|
156 |
}
|
| 91 |
|
157 |
|
| 92 |
|
158 |
|
| 93 |
/// <summary>
|
159 |
/// <summary>
|
| 94 |
/// A Base Class designed to work with the findAndProcessPackageElements method.
|
160 |
/// A Base Class designed to work with the findAndProcessPackageElements method.
|
| Line 108... |
Line 174... |
| 108 |
{
|
174 |
{
|
| 109 |
}
|
175 |
}
|
| 110 |
}
|
176 |
}
|
| 111 |
|
177 |
|
| 112 |
|
178 |
|
| - |
|
179 |
|
| - |
|
180 |
/// <summary>
|
| - |
|
181 |
/// This class is one derived from the EA_UtilitiesRecursionWorker base class so that
|
| - |
|
182 |
/// an instance of it can be used as a parameter in the EA_Utilities.findAndProcessPackageElements
|
| - |
|
183 |
/// method which recursively parses a given package. Thus, clients can parse EA model structure but
|
| - |
|
184 |
/// specify their own functionality to be carried out on packages and elements found in the
|
| - |
|
185 |
/// parsing.
|
| - |
|
186 |
/// This particular derived class is designed to collect a list of element names from the
|
| - |
|
187 |
/// package, from elements that have a type that is acceptable.
|
| - |
|
188 |
/// </summary>
|
| - |
|
189 |
public class ElementAccumulator : EA_UtilitiesRecursionWorker
|
| - |
|
190 |
{
|
| - |
|
191 |
public ArrayList Elements = null;
|
| - |
|
192 |
public ArrayList ElementIDs = null;
|
| - |
|
193 |
private ArrayList validElementTypes = null;
|
| - |
|
194 |
|
| - |
|
195 |
public ElementAccumulator(ArrayList elementTypeList): base()
|
| - |
|
196 |
{
|
| - |
|
197 |
validElementTypes = elementTypeList;
|
| - |
|
198 |
Elements = new ArrayList();
|
| - |
|
199 |
ElementIDs = new ArrayList();
|
| - |
|
200 |
}
|
| - |
|
201 |
|
| - |
|
202 |
public override void processElement( EA.Element theElement )
|
| - |
|
203 |
{
|
| - |
|
204 |
if (validElementTypes.Contains( theElement.Type ))
|
| - |
|
205 |
{
|
| - |
|
206 |
Elements.Add( theElement );
|
| - |
|
207 |
ElementIDs.Add( theElement.ElementID );
|
| - |
|
208 |
}
|
| - |
|
209 |
}
|
| - |
|
210 |
}
|
| - |
|
211 |
|
| 113 |
}
|
212 |
}
|