当前位置: 首页>>代码示例>>C#>>正文


C# EntityType.IsThirdLevelAdministrativeUnit方法代码示例

本文整理汇总了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;
        }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:51,代码来源:Extensions.cs


注:本文中的EntityType.IsThirdLevelAdministrativeUnit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。