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

GetDelegateTypeOfPossibleExpression() public méthode

public GetDelegateTypeOfPossibleExpression ( ) : CType
Résultat CType
        public CType GetDelegateTypeOfPossibleExpression()
        {
            if (isPredefType(PredefinedType.PT_G_EXPRESSION))
            {
                return AsAggregateType().GetTypeArgsThis().Item(0);
            }

            return this;
        }

Usage Example

        ////////////////////////////////////////////////////////////////////////////////
        //
        // Input types
        //
        private bool DoesInputTypeContain(EXPR pSource, CType pDest,
            TypeParameterType pParam)
        {
            // SPEC: If E is a method group or an anonymous function and T is a delegate
            // SPEC: CType or expression tree CType then all the parameter types of T are
            // SPEC: input types of E with CType T.

            pDest = pDest.GetDelegateTypeOfPossibleExpression();
            if (!pDest.isDelegateType())
            {
                return false; // No input types.
            }

            if (!pSource.isUNBOUNDLAMBDA() && !pSource.isMEMGRP())
            {
                return false; // No input types.
            }

            TypeArray pDelegateParameters =
                pDest.AsAggregateType().GetDelegateParameters(GetSymbolLoader());
            if (pDelegateParameters == null)
            {
                return false;
            }
            return TypeManager.ParametersContainTyVar(pDelegateParameters, pParam);
        }
All Usage Examples Of Microsoft.CSharp.RuntimeBinder.Semantics.CType::GetDelegateTypeOfPossibleExpression