コード例 #1
0
ファイル: Commons.cs プロジェクト: PlumpMath/CAM
        internal static void ThrowIfDeclaringTypeNotGeneric(CILElementOwnedByType element, CILTypeBase[] gArgs)
        {
            var gDef = element.DeclaringType.GenericDefinition;

            if (gDef == null && gArgs != null && gArgs.Length != 0)
            {
                throw new InvalidOperationException("This method can only be used on elements declared in generic types.");
            }
        }
コード例 #2
0
ファイル: Commons.cs プロジェクト: PlumpMath/CAM
        internal static void ThrowIfDeclaringTypeGenericButNotGDef(CILElementOwnedByType element)
        {
            var gDef = element.DeclaringType.GenericDefinition;

            if (gDef != null && !Object.ReferenceEquals(gDef, element.DeclaringType))
            {
                throw new InvalidOperationException("This method can not be used on generic types, which are not generic type definitions.");
            }
        }