public override void load(EA.Repository rep) { _attr = rep.GetAttributeByGuid(GUID); _Name = _attr.Name; _Description = _attr.Notes; _Stereotype = _attr.StereotypeEx; }
public void showObjectProperties(EA.Repository Repository, string GUID, EA.ObjectType ot) { eaObjectType.Text = ot.ToString(); eaObjectName.Text = "?"; switch(ot) { case EA.ObjectType.otAttribute: EA.Attribute attribute = Repository.GetAttributeByGuid(GUID); currentEaObject = attribute; currentEaObjectCollections = null; eaObjectName.Text = attribute.Name; showEmbeddedObjects.Enabled = false; showEmbeddedObjects.Checked = false; break; case EA.ObjectType.otElement: EA.Element element = Repository.GetElementByGuid(GUID); currentEaObject = element; currentEaObjectCollections = new EAElementCollections(element); eaObjectName.Text = element.Name; showEmbeddedObjects.Enabled = true; break; case EA.ObjectType.otMethod: EA.Method method = Repository.GetMethodByGuid(GUID); currentEaObject = method; currentEaObjectCollections = null; eaObjectName.Text = method.Name; showEmbeddedObjects.Enabled = false; showEmbeddedObjects.Checked = false; break; case EA.ObjectType.otPackage: EA.Package package = Repository.GetPackageByGuid(GUID); currentEaObject = package; currentEaObjectCollections = new EAPackageCollections(package); eaObjectName.Text = package.Name; showEmbeddedObjects.Enabled = true; break; case EA.ObjectType.otConnector: EA.Connector connector = Repository.GetConnectorByGuid(GUID); currentEaObject = connector; currentEaObjectCollections = null; showEmbeddedObjects.Enabled = false; showEmbeddedObjects.Checked = false; break; default: currentEaObject = null; currentEaObjectCollections = null; propertyGrid.SelectedObject = null; showEmbeddedObjects.Enabled = false; showEmbeddedObjects.Checked = false; break; } SynchPropertyGridSelection(); }
/// <summary> /// method changes scope of attribute /// </summary> /// <param name="Repository">EA repository</param> /// <param name="attributeGUID">GUID of changed attribute</param> /// <param name="scope">new scope of changed attribute</param> /// <param name="oldScope">previous scope of changed attribute</param> public void changeAttributeVisibility(EA.Repository Repository, string attributeGUID, string scope, string oldScope) { EA.Attribute attribute = (EA.Attribute)Repository.GetAttributeByGuid(attributeGUID); attribute.Visibility = scope; attribute.Update(); EA.Element element = (EA.Element)Repository.GetElementByID(attribute.ParentID); BPAddIn.synchronizationWindow.addToList("Change of scope of attribute '" + attribute.Name + "' - previous scope: '" + oldScope + "', current scope: '" + scope + "' (Attribute of element '" + element.Name + "', location of element: " + itemTypes.getLocationOfItem(Repository, element.PackageID, element.ParentID)); }
/// <summary> /// method deletes attribute from element /// </summary> /// <param name="Repository">EA repository</param> /// <param name="attributeGUID">GUID of attribute that should be deleted</param> public void deleteAttribute(EA.Repository Repository, string attributeGUID) { EA.Attribute attribute = (EA.Attribute)Repository.GetAttributeByGuid(attributeGUID); string name = attribute.Name; EA.Element element = (EA.Element)Repository.GetElementByID(attribute.ParentID); for (short i = 0; i < element.Attributes.Count; i++) { EA.Attribute actualAttribute = (EA.Attribute)element.Attributes.GetAt(i); if (actualAttribute.AttributeGUID == attributeGUID) { element.Attributes.DeleteAt(i, false); break; } } element.Attributes.Refresh(); BPAddIn.synchronizationWindow.addToList("Deletion of attribute '" + name + "' from element '" + element.Name + "' (Location of element: " + itemTypes.getLocationOfItem(Repository, element.PackageID, element.ParentID)); }
public void RunAttributeRule(EA.Repository Repository, string sRuleID, string AttributeGUID, long ObjectID) { EA.Attribute Attribute = Repository.GetAttributeByGuid(AttributeGUID); if (Attribute != null) { switch (LookupMapEx(sRuleID)) { case rule12: DoRule12(Repository, Attribute); break; default: break; } } }
public FindAndReplaceItemAttribute(EA.Repository rep, string GUID) :base(rep, GUID) { this._attr = rep.GetAttributeByGuid(GUID); this.load(rep); }