Microsoft.CSharp.RuntimeBinder.Semantics.CType.GetNakedType C# (CSharp) Méthode

GetNakedType() public méthode

public GetNakedType ( bool fStripNub ) : CType
fStripNub bool
Résultat CType
        public CType GetNakedType(bool fStripNub)
        {
            for (CType type = this; ;)
            {
                switch (type.GetTypeKind())
                {
                    default:
                        return type;

                    case TypeKind.TK_NullableType:
                        if (!fStripNub)
                            return type;
                        type = type.GetBaseOrParameterOrElementType();
                        break;
                    case TypeKind.TK_ArrayType:
                    case TypeKind.TK_ParameterModifierType:
                    case TypeKind.TK_PointerType:
                        type = type.GetBaseOrParameterOrElementType();
                        break;
                }
            }
        }
        public AggregateSymbol GetNakedAgg()

Usage Example

Exemple #1
0
        public virtual bool CheckTypeAccess(CType type, Symbol symWhere)
        {
            Debug.Assert(type != null);

            // Array, Ptr, Nub, etc don't matter.
            type = type.GetNakedType(true);

            if (!(type is AggregateType ats))
            {
                Debug.Assert(type is VoidType || type is ErrorType || type is TypeParameterType);
                return(true);
            }

            do
            {
                if (ACCESSERROR.ACCESSERROR_NOERROR != CheckAccessCore(ats.GetOwningAggregate(), ats.outerType, symWhere, null))
                {
                    return(false);
                }

                ats = ats.outerType;
            } while(ats != null);

            TypeArray typeArgs = ((AggregateType)type).GetTypeArgsAll();

            for (int i = 0; i < typeArgs.Count; i++)
            {
                if (!CheckTypeAccess(typeArgs[i], symWhere))
                {
                    return(false);
                }
            }

            return(true);
        }
All Usage Examples Of Microsoft.CSharp.RuntimeBinder.Semantics.CType::GetNakedType