Subversion Repositories DevTools

Rev

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

Rev 2088 Rev 2106
Line 5... Line 5...
5
   /// <summary>
5
   /// <summary>
6
	/// Class containing EA model find/search functions. 
6
	/// Class containing EA model find/search functions. 
7
	/// </summary>
7
	/// </summary>
8
	public class EA_Finders
8
	public class EA_Finders
9
	{
9
	{
10
      private EA.Repository EA_Repository = null;
-
 
11
 
10
 
12
		public EA_Finders()
-
 
13
		{
-
 
14
		}
-
 
15
 
-
 
16
      public void accept_EA_RepositoryRef(EA.Repository EA_RepositoryRef)
-
 
17
      {
-
 
18
         EA_Repository = EA_RepositoryRef;
-
 
19
      }
-
 
20
 
-
 
21
 
-
 
22
      // These find functions used to be recursive searches because for some reason I originally 
-
 
23
      // found that the repository GetXXXByGUID() functions did not work. However, I now put this
-
 
24
      // down to me passing in the wrong form of GUID string, so now I have reverted back to using
-
 
25
      // the automation interface functions directly and they seem to work and they work a hell of
-
 
26
      // a lot faster than my own search functions. I will leave the wrappers here for now just in
-
 
27
      // case.
-
 
28
 
-
 
29
      public EA.Package findPackageInRepositoryByGUID(string theGUID)
-
 
30
      {
-
 
31
         return EA_Repository.GetPackageByGuid(theGUID);
-
 
32
      }
-
 
33
 
-
 
34
      public EA.Diagram findDiagramInRepositoryByGUID(string theGUID)
-
 
35
      {
-
 
36
         return (EA.Diagram)EA_Repository.GetDiagramByGuid(theGUID);
-
 
37
      }
-
 
38
  
-
 
39
      public EA.Element findElementInRepositoryByGUID(string theGUID)
-
 
40
      {
-
 
41
         return EA_Repository.GetElementByGuid(theGUID);
-
 
42
      }
-
 
43
      
-
 
44
 
-
 
45
 
-
 
46
      public bool elementNameExistsInPackage(EA.Package parentPackage, string name)
11
      public static bool elementNameExistsInPackage(EA.Package parentPackage, string name)
47
      {
12
      {
48
         foreach (EA.Element element in parentPackage.Elements)
13
         foreach (EA.Element element in parentPackage.Elements)
49
         {
14
         {
50
            if (element.Name.ToString() == name)
15
            if (element.Name.ToString() == name)
51
            {
16
            {