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


C# TypeUsage.EdmEquals方法代码示例

本文整理汇总了C#中TypeUsage.EdmEquals方法的典型用法代码示例。如果您正苦于以下问题:C# TypeUsage.EdmEquals方法的具体用法?C# TypeUsage.EdmEquals怎么用?C# TypeUsage.EdmEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TypeUsage的用法示例。


在下文中一共展示了TypeUsage.EdmEquals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryGetCommonType

        /// <summary>
        /// Determines if a common super type (LUB) exists between type1 and type2.
        /// </summary>
        /// <param name="type1"></param>
        /// <param name="type2"></param>
        /// <param name="commonType"></param>
        /// <returns>
        /// true if a common super type between type1 and type2 exists and out commonType represents the common super type.
        /// false otherwise along with commonType as null
        /// </returns>
        internal static bool TryGetCommonType(TypeUsage type1, TypeUsage type2, out TypeUsage commonType)
        {
            Debug.Assert(type1 != null, "type1 must not be NULL");
            Debug.Assert(type2 != null, "type2 must not be NULL");

            commonType = null;

            if (type1.EdmEquals(type2))
            {
                commonType = ForgetConstraints(type2);
                return true;
            }

            if (Helper.IsPrimitiveType(type1.EdmType) && Helper.IsPrimitiveType(type2.EdmType))
            {
                return TryGetCommonPrimitiveType(type1, type2, out commonType);
            }

            EdmType commonEdmType;
            if (TryGetCommonType(type1.EdmType, type2.EdmType, out commonEdmType))
            {
                commonType = ForgetConstraints(TypeUsage.Create(commonEdmType));
                return true;
            }

            commonType = null;
            return false;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:38,代码来源:TypeSemantics.cs

示例2: IsSubTypeOf

        /// <summary>
        ///     determines if subType is equal to or a sub-type of superType.
        /// </summary>
        /// <param name="subType"> </param>
        /// <param name="superType"> </param>
        /// <returns> true if subType is equal to or a sub-type of superType, false otherwise </returns>
        internal static bool IsSubTypeOf(TypeUsage subType, TypeUsage superType)
        {
            DebugCheck.NotNull(subType);
            DebugCheck.NotNull(superType);

            if (subType.EdmEquals(superType))
            {
                return true;
            }

            if (Helper.IsPrimitiveType(subType.EdmType)
                && Helper.IsPrimitiveType(superType.EdmType))
            {
                return IsPrimitiveTypeSubTypeOf(subType, superType);
            }

            return subType.IsSubtypeOf(superType);
        }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:24,代码来源:TypeSemantics.cs

示例3: IsSubTypeOf

        /// <summary>
        /// determines if subType is equal to or a sub-type of superType.
        /// </summary>
        /// <param name="subType"></param>
        /// <param name="superType"></param>
        /// <returns>true if subType is equal to or a sub-type of superType, false otherwise</returns>
        internal static bool IsSubTypeOf(TypeUsage subType, TypeUsage superType)
        {
            Debug.Assert(subType != null, "subType must not be NULL");
            Debug.Assert(superType != null, "superType must not be NULL");

            if (subType.EdmEquals(superType))
            {
                return true;
            }

            if (Helper.IsPrimitiveType(subType.EdmType) && Helper.IsPrimitiveType(superType.EdmType))
            {
                return IsPrimitiveTypeSubTypeOf(subType, superType);
            }

            return subType.IsSubtypeOf(superType);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:23,代码来源:TypeSemantics.cs

示例4: TryGetCommonType

        /// <summary>
        ///     Determines if a common super type (LUB) exists between type1 and type2.
        /// </summary>
        /// <param name="type1"> </param>
        /// <param name="type2"> </param>
        /// <param name="commonType"> </param>
        /// <returns> true if a common super type between type1 and type2 exists and out commonType represents the common super type. false otherwise along with commonType as null </returns>
        internal static bool TryGetCommonType(TypeUsage type1, TypeUsage type2, out TypeUsage commonType)
        {
            DebugCheck.NotNull(type1);
            DebugCheck.NotNull(type2);

            commonType = null;

            if (type1.EdmEquals(type2))
            {
                commonType = ForgetConstraints(type2);
                return true;
            }

            if (Helper.IsPrimitiveType(type1.EdmType)
                && Helper.IsPrimitiveType(type2.EdmType))
            {
                return TryGetCommonPrimitiveType(type1, type2, out commonType);
            }

            EdmType commonEdmType;
            if (TryGetCommonType(type1.EdmType, type2.EdmType, out commonEdmType))
            {
                commonType = ForgetConstraints(TypeUsage.Create(commonEdmType));
                return true;
            }

            commonType = null;
            return false;
        }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:36,代码来源:TypeSemantics.cs


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