Mono.CSharp.Delegate.GetInvokeMethod C# (CSharp) Method

GetInvokeMethod() public static method

public static GetInvokeMethod ( CompilerContext ctx, System.TypeSpec delType ) : MethodSpec
ctx CompilerContext
delType System.TypeSpec
return MethodSpec
		public static MethodSpec GetInvokeMethod (CompilerContext ctx, TypeSpec delType)
		{
			var invoke = MemberCache.FindMember (delType,
				MemberFilter.Method (InvokeMethodName, 0, null, null),
				BindingRestriction.DeclaredOnly);

			return (MethodSpec) invoke;
		}

Usage Example

Example #1
0
        public static bool ImplicitStandardConversionExists(ResolveContext ec, MethodGroupExpr mg, TypeSpec target_type)
        {
            if (target_type == TypeManager.delegate_type || target_type == TypeManager.multicast_delegate_type)
            {
                return(false);
            }

            var invoke = Delegate.GetInvokeMethod(target_type);

            Arguments arguments = CreateDelegateMethodArguments(invoke.Parameters, invoke.Parameters.Types, mg.Location);

            return(mg.OverloadResolve(ec, ref arguments, null, OverloadResolver.Restrictions.CovariantDelegate | OverloadResolver.Restrictions.ProbingOnly) != null);
        }
All Usage Examples Of Mono.CSharp.Delegate::GetInvokeMethod