Subversion Repositories DevTools

Rev

Rev 2151 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2151 Rev 2153
Line 23... Line 23...
23
      /// a user to specify what processing is to be done upon or with each element found.
23
      /// a user to specify what processing is to be done upon or with each element found.
24
      /// </summary>
24
      /// </summary>
25
      /// <param name="thePackage"></param>
25
      /// <param name="thePackage"></param>
26
      /// <param name="worker"></param>
26
      /// <param name="worker"></param>
27
      /// <param name="recurse"></param>
27
      /// <param name="recurse"></param>
28
      public void findAndProcessPackageElements( EA.Package thePackage, EA_UtilitiesRecursionWorker worker, bool recurse)
28
      public static void findAndProcessPackageElements( EA.Package thePackage, EA_UtilitiesRecursionWorker worker, bool recurse)
29
      {
29
      {
30
         worker.processPackage( thePackage );
30
         worker.processPackage( thePackage );
31
 
31
 
32
         foreach (EA.Element theElement in thePackage.Elements)
32
         foreach (EA.Element theElement in thePackage.Elements)
33
         {
33
         {
Line 44... Line 44...
44
         }
44
         }
45
 
45
 
46
      }
46
      }
47
 
47
 
48
 
48
 
49
      public string ReadTag(EA.Element theElement, string tagName)
49
      public static string ReadTag(EA.Element theElement, string tagName)
50
      {
50
      {
51
         string result;
51
         string result;
52
 
52
 
53
         EA.TaggedValue tag = (EA.TaggedValue)theElement.TaggedValues.GetByName(tagName);
53
         EA.TaggedValue tag = (EA.TaggedValue)theElement.TaggedValues.GetByName(tagName);
54
         if (null != tag)
54
         if (null != tag)
Line 61... Line 61...
61
         }
61
         }
62
         return result;
62
         return result;
63
      }
63
      }
64
 
64
 
65
 
65
 
66
      public bool WriteTag(EA.Element theElement, string tagName, string value)
66
      public static bool WriteTag(EA.Element theElement, string tagName, string value)
67
      {
67
      {
68
         bool result;
68
         bool result;
69
         EA.TaggedValue tag;
69
         EA.TaggedValue tag;
70
            
70
            
71
         tag = (EA.TaggedValue)theElement.TaggedValues.GetByName(tagName);
71
         tag = (EA.TaggedValue)theElement.TaggedValues.GetByName(tagName);
Line 88... Line 88...
88
         }
88
         }
89
         return result;
89
         return result;
90
      }
90
      }
91
 
91
 
92
 
92
 
93
      public EA.Package get_selected_package()
93
      public static EA.Package get_selected_package()
94
      {
94
      {
95
         object o;
95
         object o;
96
         EA.ObjectType type;
96
         EA.ObjectType type;
97
 
97
 
98
         type = Main.EA_Repository.GetTreeSelectedItem(out o);
98
         type = Main.EA_Repository.GetTreeSelectedItem(out o);
Line 113... Line 113...
113
      /// </summary>
113
      /// </summary>
114
      /// <param name="parentPackage"></param>
114
      /// <param name="parentPackage"></param>
115
      /// <param name="name"></param>
115
      /// <param name="name"></param>
116
      /// <param name="treePos"></param>
116
      /// <param name="treePos"></param>
117
      /// <returns></returns>
117
      /// <returns></returns>
118
      public EA.Package createPackage(EA.Package parentPackage, string name, int treePos)
118
      public static EA.Package createPackage(EA.Package parentPackage, string name, int treePos)
119
      {
119
      {
120
         EA.Package newobj = (EA.Package)parentPackage.Packages.AddNew(name, "Package");
120
         EA.Package newobj = (EA.Package)parentPackage.Packages.AddNew(name, "Package");
121
         newobj.TreePos = treePos;
121
         newobj.TreePos = treePos;
122
         newobj.Update();
122
         newobj.Update();
123
         return newobj;
123
         return newobj;
124
      }
124
      }
125
 
125
 
126
      public void DumpEAElement()
126
      public static void DumpEAElement()
127
      {
127
      {
128
         EA.Element ea_ele = (EA.Element)Main.EA_Repository.GetTreeSelectedObject();
128
         EA.Element ea_ele = (EA.Element)Main.EA_Repository.GetTreeSelectedObject();
129
 
129
 
130
         Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "EA Element : " + ea_ele.Name, ea_ele.ElementID);
130
         Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME, "EA Element : " + ea_ele.Name, ea_ele.ElementID);
131
         Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME,               "Author : " + ea_ele.Author, -1);
131
         Main.EA_Repository.WriteOutput( Main.GUI_OUTPUT_TAB_NAME,               "Author : " + ea_ele.Author, -1);