本文整理汇总了C#中Generated.setGuid方法的典型用法代码示例。如果您正苦于以下问题:C# Generated.setGuid方法的具体用法?C# Generated.setGuid怎么用?C# Generated.setGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generated
的用法示例。
在下文中一共展示了Generated.setGuid方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ensureGuidProcedure
/// <summary>
/// Ensures that two Procedure have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidProcedure(Generated.Procedure obj, Generated.Procedure other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
ensureGuidReqRelated (obj, other);
ensureGuidStateMachine ( obj.getStateMachine(), other.getStateMachine() );
if ( obj.allRules() != null )
{
if ( other.allRules() != null )
{
foreach ( Generated.Rule subElement in obj.allRules() )
{
bool found = false;
// Try first to assign Guid to elements which do not have a guid
// This helps handling duplicated in lists
foreach ( Generated.Rule otherElement in other.allRules() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
{
ensureGuidRule ( subElement, otherElement );
found = true;
break;
}
}
if ( !found )
{
foreach ( Generated.Rule otherElement in other.allRules() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
ensureGuidRule ( subElement, otherElement );
found = true;
break;
}
}
}
if ( !found )
{
ensureGuidRule ( subElement, null );
}
}
foreach ( Generated.Rule otherElement in other.allRules() )
{
bool found = false;
foreach ( Generated.Rule subElement in obj.allRules() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
found = true;
break;
}
}
if ( !found )
{
//.........这里部分代码省略.........
示例2: ensureGuidNameSpace
/// <summary>
/// Ensures that two NameSpace have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidNameSpace(Generated.NameSpace obj, Generated.NameSpace other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
ensureGuidNamable (obj, other);
if ( obj.allNameSpaces() != null )
{
if ( other.allNameSpaces() != null )
{
foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
{
bool found = false;
// Try first to assign Guid to elements which do not have a guid
// This helps handling duplicated in lists
foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
{
ensureGuidNameSpace ( subElement, otherElement );
found = true;
break;
}
}
if ( !found )
{
foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
ensureGuidNameSpace ( subElement, otherElement );
found = true;
break;
}
}
}
if ( !found )
{
ensureGuidNameSpace ( subElement, null );
}
}
foreach ( Generated.NameSpace otherElement in other.allNameSpaces() )
{
bool found = false;
foreach ( Generated.NameSpace subElement in obj.allNameSpaces() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
found = true;
break;
}
}
if ( !found )
{
ensureGuidNameSpace ( null, otherElement );
//.........这里部分代码省略.........
示例3: ensureGuidPreCondition
/// <summary>
/// Ensures that two PreCondition have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidPreCondition(Generated.PreCondition obj, Generated.PreCondition other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
}
示例4: ensureGuidEnum
/// <summary>
/// Ensures that two Enum have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidEnum(Generated.Enum obj, Generated.Enum other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
ensureGuidType (obj, other);
if ( obj.allValues() != null )
{
if ( other.allValues() != null )
{
int i = 0;
while ( i < obj.countValues() && i < other.countValues() )
{
Generated.EnumValue element = obj.getValues( i );
Generated.EnumValue otherElement = other.getValues( i );
ensureGuidEnumValue ( element, otherElement );
i += 1;
}
while ( i < obj.countValues() )
{
Generated.EnumValue element = obj.getValues( i );
ensureGuidEnumValue ( element, null );
i += 1;
}
while ( i < other.countValues() )
{
Generated.EnumValue otherElement = other.getValues( i );
ensureGuidEnumValue ( null, otherElement );
i += 1;
}
}
else
{
foreach ( Generated.EnumValue subElement in obj.allValues() )
{
ensureGuidEnumValue ( subElement, null );
}
}
}
else
{
if ( other.allValues() != null )
{
foreach ( Generated.EnumValue otherElement in other.allValues() )
{
ensureGuidEnumValue ( null, otherElement );
}
}
}
if ( obj.allSubEnums() != null )
{
if ( other.allSubEnums() != null )
{
foreach ( Generated.Enum subElement in obj.allSubEnums() )
{
bool found = false;
// Try first to assign Guid to elements which do not have a guid
// This helps handling duplicated in lists
foreach ( Generated.Enum otherElement in other.allSubEnums() )
//.........这里部分代码省略.........
示例5: ensureGuidDictionary
/// <summary>
/// Ensures that two Dictionary have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidDictionary(Generated.Dictionary obj, Generated.Dictionary other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
if ( obj.allSpecifications() != null )
{
if ( other.allSpecifications() != null )
{
foreach ( Generated.Specification subElement in obj.allSpecifications() )
{
bool found = false;
// Try first to assign Guid to elements which do not have a guid
// This helps handling duplicated in lists
foreach ( Generated.Specification otherElement in other.allSpecifications() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
{
ensureGuidSpecification ( subElement, otherElement );
found = true;
break;
}
}
if ( !found )
{
foreach ( Generated.Specification otherElement in other.allSpecifications() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
ensureGuidSpecification ( subElement, otherElement );
found = true;
break;
}
}
}
if ( !found )
{
ensureGuidSpecification ( subElement, null );
}
}
foreach ( Generated.Specification otherElement in other.allSpecifications() )
{
bool found = false;
foreach ( Generated.Specification subElement in obj.allSpecifications() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
found = true;
break;
}
}
if ( !found )
{
ensureGuidSpecification ( null, otherElement );
}
}
//.........这里部分代码省略.........
示例6: ensureGuidCase
/// <summary>
/// Ensures that two Case have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidCase(Generated.Case obj, Generated.Case other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
ensureGuidNamable (obj, other);
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 );
ensureGuidPreCondition ( element, otherElement );
i += 1;
}
while ( i < obj.countPreConditions() )
{
Generated.PreCondition element = obj.getPreConditions( i );
ensureGuidPreCondition ( element, null );
i += 1;
}
while ( i < other.countPreConditions() )
{
Generated.PreCondition otherElement = other.getPreConditions( i );
ensureGuidPreCondition ( null, otherElement );
i += 1;
}
}
else
{
foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
{
ensureGuidPreCondition ( subElement, null );
}
}
}
else
{
if ( other.allPreConditions() != null )
{
foreach ( Generated.PreCondition otherElement in other.allPreConditions() )
{
ensureGuidPreCondition ( null, otherElement );
}
}
}
}
示例7: ensureGuidTranslation
/// <summary>
/// Ensures that two Translation have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidTranslation(Generated.Translation obj, Generated.Translation other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
ensureGuidReferencesParagraph (obj, other);
if ( obj.allSourceTexts() != null )
{
if ( other.allSourceTexts() != null )
{
foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
{
bool found = false;
// Try first to assign Guid to elements which do not have a guid
// This helps handling duplicated in lists
foreach ( Generated.SourceText otherElement in other.allSourceTexts() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) && otherElement.getGuid() == null )
{
ensureGuidSourceText ( subElement, otherElement );
found = true;
break;
}
}
if ( !found )
{
foreach ( Generated.SourceText otherElement in other.allSourceTexts() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
ensureGuidSourceText ( subElement, otherElement );
found = true;
break;
}
}
}
if ( !found )
{
ensureGuidSourceText ( subElement, null );
}
}
foreach ( Generated.SourceText otherElement in other.allSourceTexts() )
{
bool found = false;
foreach ( Generated.SourceText subElement in obj.allSourceTexts() )
{
if ( CompareUtil.canonicalStringEquality(subElement.Name, otherElement.Name) )
{
found = true;
break;
}
}
if ( !found )
{
ensureGuidSourceText ( null, otherElement );
//.........这里部分代码省略.........
示例8: ensureGuidState
/// <summary>
/// Ensures that two State have matching GUID, and recursively.
/// obj is the leader for Guid. If other doesn't match obj guid,
/// 1. other does not have a guid, in that case, other should have the same guid as obj
/// 2. other already has a guid. In that case, there is a mismatch between objects, and the process stops here
/// </summary>
/// <param name="obj"></param>
/// <param name="other"></param>
public static void ensureGuidState(Generated.State obj, Generated.State other)
{
if ( obj == null )
{
if ( other != null )
{
// Side effect, setup a GUID if needed for the other part (other)
string guid = other.Guid;
}
return;
}
if ( other == null )
{
if ( obj != null )
{
// Side effect, setup a GUID if needed for the other part (obj)
string guid = obj.Guid;
}
return;
}
if ( obj.Guid != other.getGuid() )
{
if ( string.IsNullOrEmpty(other.getGuid()) || GuidByName && (obj.Name == other.Name) )
{
// These are matching elements, copy the guid from obj
other.setGuid ( obj.Guid );
}
else
{
// Elements do not match. Stop the recursive process
return;
}
}
ensureGuidReqRelated (obj, other);
ensureGuidStateMachine ( obj.getStateMachine(), other.getStateMachine() );
ensureGuidRule ( obj.getEnterAction(), other.getEnterAction() );
ensureGuidRule ( obj.getLeaveAction(), other.getLeaveAction() );
}