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
	/// Summary description for EA_ProjectBrowser.
8
	/// </summary>
9
	public class EA_ProjectBrowser
10
	{
11
		public EA_ProjectBrowser()
12
		{
13
		}
14
 
15
      public static EA.Element get_selected_element(ArrayList allowedElementTypes)
16
      {
17
         object o;
18
         EA.ObjectType type;
19
 
20
         type = Main.EA_Repository.GetTreeSelectedItem(out o);
21
         if (type == EA.ObjectType.otElement)
22
         {
23
            if (allowedElementTypes == null)
24
               return (EA.Element)o;
25
 
26
            if (allowedElementTypes.Contains( ((EA.Element)o).Type ))
27
               return (EA.Element)o;
28
         }
29
         return null;
30
      }
31
 
32
      public static EA.Package get_selected_package()
33
      {
34
         object o;
35
         EA.ObjectType type;
36
 
37
         type = Main.EA_Repository.GetTreeSelectedItem(out o);
38
         if (type == EA.ObjectType.otElement)
39
         {
40
            return Main.EA_Repository.GetPackageByID(((EA.Element)o).PackageID);
41
         }
42
         else if (type == EA.ObjectType.otDiagram)
43
         {
44
            return Main.EA_Repository.GetPackageByID(((EA.Diagram)o).PackageID);
45
         }
46
         else if (type == EA.ObjectType.otPackage)
47
         {
48
            return (EA.Package)o;
49
         }
50
         return null;
51
      }
52
	}
53
}