本文整理汇总了C#中EA.GetAttributeByGuid方法的典型用法代码示例。如果您正苦于以下问题:C# EA.GetAttributeByGuid方法的具体用法?C# EA.GetAttributeByGuid怎么用?C# EA.GetAttributeByGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EA
的用法示例。
在下文中一共展示了EA.GetAttributeByGuid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: load
public override void load(EA.Repository rep)
{
_attr = rep.GetAttributeByGuid(GUID);
_Name = _attr.Name;
_Description = _attr.Notes;
_Stereotype = _attr.StereotypeEx;
}
示例2: showObjectProperties
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();
}
示例3: changeAttributeVisibility
/// <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));
}
示例4: deleteAttribute
/// <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));
}
示例5: RunAttributeRule
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;
}
}
}
示例6: FindAndReplaceItemAttribute
public FindAndReplaceItemAttribute(EA.Repository rep, string GUID) :base(rep, GUID)
{
this._attr = rep.GetAttributeByGuid(GUID);
this.load(rep);
}