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

isEnumType() public méthode

public isEnumType ( ) : bool
Résultat bool
        public bool isEnumType()
        {
            return (IsAggregateType() && getAggregate().IsEnum());
        }
        public bool isInterfaceType()

Usage Example

Exemple #1
0
            private bool bindImplicitConversionFromAgg(AggregateType aggTypeSrc)
            {
                // GENERICS: The case for constructed types is very similar to types with
                // no parameters. The parameters are irrelevant for most of the conversions
                // below. They could be relevant if we had user-defined conversions on
                // generic types.

                AggregateSymbol aggSrc = aggTypeSrc.getAggregate();

                if (aggSrc.IsEnum())
                {
                    return(bindImplicitConversionFromEnum(aggTypeSrc));
                }

                if (_typeDest.isEnumType())
                {
                    if (bindImplicitConversionToEnum(aggTypeSrc))
                    {
                        return(true);
                    }
                    // Even though enum is sealed, a class can derive from enum in LAF scenarios --
                    // continue testing for derived to base conversions below.
                }
                else if (aggSrc.getThisType().isSimpleType() && _typeDest.isSimpleType())
                {
                    if (bindImplicitConversionBetweenSimpleTypes(aggTypeSrc))
                    {
                        return(true);
                    }
                    // No simple conversion -- continue testing for derived to base conversions below.
                }

                return(bindImplicitConversionToBase(aggTypeSrc));
            }
All Usage Examples Of Microsoft.CSharp.RuntimeBinder.Semantics.CType::isEnumType