本文整理汇总了C#中EntityType.IsThirdLevelAdministrativeUnit方法的典型用法代码示例。如果您正苦于以下问题:C# EntityType.IsThirdLevelAdministrativeUnit方法的具体用法?C# EntityType.IsThirdLevelAdministrativeUnit怎么用?C# EntityType.IsThirdLevelAdministrativeUnit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityType
的用法示例。
在下文中一共展示了EntityType.IsThirdLevelAdministrativeUnit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsCompatibleEntityType
/// <summary>
/// Gets whether two entity types are at the same administrative level.
/// </summary>
/// <param name="value">Entity type.</param>
/// <param name="compare">Entity type to compare with.</param>
/// <returns><c>true</c> if both types are at same administrative level or equal, <c>false otherwise.</c></returns>
/// <remarks>The following combinations are tested.
/// <list type="bullet">
/// <item><description><see cref="EntityType.Bangkok"/> and <see cref="EntityType.Changwat"/>.</description></item>
/// <item><description><see cref="EntityType.Amphoe"/>, <see cref="EntityType.KingAmphoe"/>, <see cref="EntityType.Khet"/> and <see cref="EntityType.Sakha"/>.</description></item>
/// <item><description><see cref="EntityType.Tambon"/> and <see cref="EntityType.Khwaeng"/>.</description></item>
/// <item><description><see cref="EntityType.Thesaban"/>, <see cref="EntityType.ThesabanTambn"/>, <see cref="EntityType.ThesabanMueanmg"/> and <see cref="EntityType.ThesabanNakhon"/>.</description></item>
/// </list></remarks>
public static Boolean IsCompatibleEntityType(this EntityType value, EntityType compare)
{
Boolean result = false;
switch ( value )
{
case EntityType.Bangkok:
case EntityType.Changwat:
result = (compare == EntityType.Changwat) | (compare == EntityType.Bangkok);
break;
case EntityType.KingAmphoe:
case EntityType.Khet:
case EntityType.Sakha:
case EntityType.Amphoe:
result = (compare == EntityType.Amphoe) | (compare == EntityType.KingAmphoe) | (compare == EntityType.Khet) | (compare == EntityType.Sakha);
break;
case EntityType.Khwaeng:
case EntityType.Tambon:
result = compare.IsThirdLevelAdministrativeUnit();
break;
case EntityType.Thesaban:
case EntityType.ThesabanNakhon:
case EntityType.ThesabanMueang:
case EntityType.ThesabanTambon:
result = compare == EntityType.Thesaban ||
compare == EntityType.ThesabanTambon ||
compare == EntityType.ThesabanMueang ||
compare == EntityType.ThesabanNakhon;
break;
default:
result = (value == compare);
break;
}
return result;
}