本文整理匯總了C#中TSF.UmlToolingFramework.Wrappers.EA.Model.adviseChange方法的典型用法代碼示例。如果您正苦於以下問題:C# Model.adviseChange方法的具體用法?C# Model.adviseChange怎麽用?C# Model.adviseChange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TSF.UmlToolingFramework.Wrappers.EA.Model
的用法示例。
在下文中一共展示了Model.adviseChange方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: correct
/// <summary>
/// Correct detected defect based on value in contentCorrect attribute
/// </summary>
/// <param name="element">Defected element</param>
/// <param name="model">Wrapper EA.Repository object</param>
/// <returns>true if correction was successful, else false</returns>
public bool correct(object element, Model model)
{
string[] correctCall = contentCorrect.Split('@');
for (int i = 0; i < correctCall.Length; i++)
{
try
{
if (correctCall[i].StartsWith("setName"))
{
string[] nameExpression = correctCall[i].Split('(', ')')[1].Split('.');
for (int j = 0; j < nameExpression.Length; j++)
{
if (nameExpression[j] == "dict")
{
Dictionary dict = new Dictionary();
if (nameExpression[j + 1].StartsWith("getBaseNoun"))
{
string attributeName = correctCall[i].Split('(', ')')[2];
string value = getStringAttributeValue(element, attributeName);
string word = dict.getBaseNoun(value);
if (word == "")
{
return false;
}
setStringAttributeValue(element, attributeName, word);
try
{
model.adviseChange((new ElementWrapper(model, (EA.Element)element)));
RuleService.active.Remove(getStringAttributeValue(element, "GUID"));
}
catch (Exception ex) { }
return true;
}
}
else
{
setStringAttributeValue(element, attributeType, nameExpression[j]);
try
{
if (element is EA.Connector)
{
model.adviseChange(new ConnectorWrapper(model, (EA.Connector)element));
}
else
{
model.adviseChange(new ElementWrapper(model, (EA.Element)element));
}
}
catch (Exception ex) { }
return true;
}
}
}
if (correctCall[i].StartsWith("setCardinalities"))
{
string nameExpression = correctCall[i].Split('(', ')')[1];
object objectClient = getAttributeValue(element, "ClientEnd");
string cardinalityClient = getStringAttributeValue(objectClient, "Cardinality");
object objectSupplier = getAttributeValue(element, "SupplierEnd");
string cardinalitySupplier = getStringAttributeValue(objectSupplier, "Cardinality");
if (String.IsNullOrEmpty(cardinalityClient))
{
setStringAttributeValue(objectClient, "Cardinality", nameExpression);
}
if (String.IsNullOrEmpty(cardinalitySupplier))
{
setStringAttributeValue(objectSupplier, "Cardinality", nameExpression);
}
try
{
model.adviseChange(new ConnectorWrapper(model, (EA.Connector)element));
}
catch (Exception ex) { }
}
if (correctCall[i].StartsWith("setExtensionPointsCount"))
{
string nameExpression = correctCall[i].Split('(', ')')[1];
if (nameExpression.StartsWith("Connector"))
{
string expr = nameExpression.Split('.')[1];
if (expr == "getStereotypeCount")
{
//.........這裏部分代碼省略.........