Esempio n. 1
0
 public EAPackageCollections(EA.Package package)
 {
     this.connectors = new EABrowsableObjectsCollection <EA.Connector>(package.Connectors);
     this.element    = package.Element;
     this.elements   = new EABrowsableObjectsCollection <EA.Element>(package.Elements);
     this.packages   = new EABrowsableObjectsCollection <EA.Package>(package.Packages);
 }
 public BrowsableCollectionPropertyDescriptor(EABrowsableObjectsCollection <T> coll, int idx)
     : base(GetNameProperty(coll, idx), null)
 {
     this.collection = coll;
     this.index      = idx;
     this.converter  = new EABrowsableObjectConverter <T>();
 }
        private static string GetNameProperty(EABrowsableObjectsCollection <T> coll, int idx)
        {
            int    displayIndex    = idx + 1;
            string name            = "#" + displayIndex.ToString();
            T      browsableObject = coll[idx];

            EA.App        app        = System.Runtime.InteropServices.Marshal.GetActiveObject("EA.App") as EA.App;
            EA.Repository repository = app.Repository;

            EADualInterface <T> dualInterface = new EADualInterface <T>(browsableObject);
            string objectName = dualInterface.GetPropertyValue("Name");

            if (!string.IsNullOrEmpty(objectName))
            {
                name = name + "(" + objectName + ")";
            }

            return(name);
        }
 public EAElementCollections(EA.Element element)
 {
     this.attributes       = new EABrowsableObjectsCollection <EA.Attribute>(element.Attributes);
     this.attributesEx     = new EABrowsableObjectsCollection <EA.Attribute>(element.AttributesEx);
     this.baseClasses      = new EABrowsableObjectsCollection <EA.Element>(element.BaseClasses);
     this.connectors       = new EABrowsableObjectsCollection <EA.Connector>(element.Connectors);
     this.constraints      = new EABrowsableObjectsCollection <EA.Constraint>(element.Constraints);
     this.constraintsEx    = new EABrowsableObjectsCollection <EA.Constraint>(element.ConstraintsEx);
     this.elements         = new EABrowsableObjectsCollection <EA.Element>(element.Elements);
     this.embeddedElements = new EABrowsableObjectsCollection <EA.Element>(element.EmbeddedElements);
     this.efforts          = new EABrowsableObjectsCollection <EA.Effort>(element.Efforts);
     this.files            = new EABrowsableObjectsCollection <EA.File>(element.Files);
     this.methods          = new EABrowsableObjectsCollection <EA.Method>(element.Methods);
     this.methodsEx        = new EABrowsableObjectsCollection <EA.Method>(element.MethodsEx);
     this.requirements     = new EABrowsableObjectsCollection <EA.Requirement>(element.Requirements);
     this.requirementsEx   = new EABrowsableObjectsCollection <EA.Requirement>(element.RequirementsEx);
     this.resources        = new EABrowsableObjectsCollection <EA.Resource>(element.Resources);
     this.risks            = new EABrowsableObjectsCollection <EA.Risk>(element.Risks);
     this.scenarios        = new EABrowsableObjectsCollection <EA.Scenario>(element.Scenarios);
     this.taggedValues     = new EABrowsableObjectsCollection <EA.TaggedValue>(element.TaggedValues);
     this.taggedValuesEx   = new EABrowsableObjectsCollection <EA.TaggedValue>(element.TaggedValuesEx);
     this.tests            = new EABrowsableObjectsCollection <EA.Test>(element.Tests);
 }