本文整理汇总了C#中Generated.getExpression方法的典型用法代码示例。如果您正苦于以下问题:C# Generated.getExpression方法的具体用法?C# Generated.getExpression怎么用?C# Generated.getExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generated
的用法示例。
在下文中一共展示了Generated.getExpression方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: compareAction
/// <summary>
/// Compares two Action and annotates the differences on the first one
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void compareAction(Generated.Action obj, Generated.Action other, VersionDiff diff)
{
if ( other == null )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
return;
}
if ( !CompareUtil.canonicalStringEquality(obj.getExpression(), other.getExpression()) )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Expression", other.getExpression(), obj.getExpression()) );
}
if ( !CompareUtil.canonicalStringEquality(obj.getComment(), other.getComment()) )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Comment", other.getComment(), obj.getComment()) );
}
}
示例2: visit
/// <summary>
/// Cleans all text fields in this element
/// </summary>
/// <param name="obj"></param>
/// <param name="visitSubNodes"></param>
public override void visit(Generated.Action obj, bool visitSubNodes)
{
if ( obj.getExpression() != null )
{
obj.setExpression(obj.getExpression().Trim());
}
if ( obj.getComment() != null )
{
obj.setComment(obj.getComment().Trim());
}
base.visit(obj, visitSubNodes);
}
示例3: compareCase
/// <summary>
/// Compares two Case and annotates the differences on the first one
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void compareCase(Generated.Case obj, Generated.Case other, VersionDiff diff)
{
if ( other == null )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
return;
}
compareNamable (obj, other, diff);
if ( obj.allPreConditions() != null )
{
if ( other.allPreConditions() != null )
{
int i = 0;
while ( i < obj.countPreConditions() && i < other.countPreConditions() )
{
Generated.PreCondition element = obj.getPreConditions( i );
Generated.PreCondition otherElement = other.getPreConditions( i );
comparePreCondition ( element, otherElement, diff );
i += 1;
}
while ( i < obj.countPreConditions() )
{
diff.appendChanges ( new Diff(obj.getPreConditions(i), HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", obj.getPreConditions( i ).Name ) );
i += 1;
}
while ( i < other.countPreConditions() )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove, "PreConditions", other.getPreConditions( i ).Name) );
i += 1;
}
}
else
{
foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
{
diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", subElement.Name ) );
}
}
}
else
{
if ( other.allPreConditions() != null )
{
foreach ( Generated.PreCondition otherElement in other.allPreConditions() )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "PreConditions", otherElement.Name) );
}
}
}
if ( !CompareUtil.canonicalStringEquality(obj.getExpression(), other.getExpression()) )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Expression", other.getExpression(), obj.getExpression()) );
}
if ( !CompareUtil.canonicalStringEquality(obj.getComment(), other.getComment()) )
{
diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Comment", other.getComment(), obj.getComment()) );
}
}
示例4: DuplicateCase
/// <summary>
/// Duplicates a source Case into its target
/// </summary>
/// <param name="source"></param>
/// <param name="target"></param>
public static void DuplicateCase(Generated.Case source, Generated.Case target)
{
if ( source != null && target != null )
{
DuplicateNamable (source, target);
target.setExpression(source.getExpression());
target.setComment(source.getComment());
}
}
示例5: DuplicateAction
/// <summary>
/// Duplicates a source Action into its target
/// </summary>
/// <param name="source"></param>
/// <param name="target"></param>
public static void DuplicateAction(Generated.Action source, Generated.Action target)
{
if ( source != null && target != null )
{
target.setExpression(source.getExpression());
target.setComment(source.getComment());
}
}
示例6: searchCase
/// <summary>
/// Searches a specific string in Case and updates the list
/// of model element with all the elements in which that string is found
/// </summary>
/// <param name="obj"></param>
/// <param name="obj">The string to search for</param>
/// <param name="occurences">The list of model elements which hold the searched string</param>
public static void searchCase(Generated.Case obj, string searchString, List<ModelElement> occurences)
{
searchNamable (obj, searchString, occurences);
if ( obj.allPreConditions() != null )
{
foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
{
searchPreCondition ( subElement, searchString, occurences );
}
}
if ( obj.getExpression() != null && obj.getExpression().Contains (searchString) )
{
occurences.Add ( obj );
}
if ( obj.getComment() != null && obj.getComment().Contains (searchString) )
{
occurences.Add ( obj );
}
}
示例7: searchAction
/// <summary>
/// Searches a specific string in Action and updates the list
/// of model element with all the elements in which that string is found
/// </summary>
/// <param name="obj"></param>
/// <param name="obj">The string to search for</param>
/// <param name="occurences">The list of model elements which hold the searched string</param>
public static void searchAction(Generated.Action obj, string searchString, List<ModelElement> occurences)
{
if ( obj.getExpression() != null && obj.getExpression().Contains (searchString) )
{
occurences.Add ( obj );
}
if ( obj.getComment() != null && obj.getComment().Contains (searchString) )
{
occurences.Add ( obj );
}
}