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

FullDelegateDesc() public static method

public static FullDelegateDesc ( MethodSpec invoke_method ) : string
invoke_method MethodSpec
return string
		public static string FullDelegateDesc (MethodSpec invoke_method)
		{
			return TypeManager.GetFullNameSignature (invoke_method).Replace (".Invoke", "");
		}
		

Usage Example

Example #1
0
        void Error_ConversionFailed(ResolveContext ec, MethodSpec method, Expression return_type)
        {
            var    invoke_method = Delegate.GetInvokeMethod(type);
            string member_name   = method_group.InstanceExpression != null?
                                   Delegate.FullDelegateDesc(method) :
                                       TypeManager.GetFullNameSignature(method);

            ec.Report.SymbolRelatedToPreviousError(type);
            ec.Report.SymbolRelatedToPreviousError(method);
            if (ec.Module.Compiler.Settings.Version == LanguageVersion.ISO_1)
            {
                ec.Report.Error(410, loc, "A method or delegate `{0} {1}' parameters and return type must be same as delegate `{2} {3}' parameters and return type",
                                TypeManager.CSharpName(method.ReturnType), member_name,
                                TypeManager.CSharpName(invoke_method.ReturnType), Delegate.FullDelegateDesc(invoke_method));
                return;
            }

            if (return_type == null)
            {
                ec.Report.Error(123, loc, "A method or delegate `{0}' parameters do not match delegate `{1}' parameters",
                                member_name, Delegate.FullDelegateDesc(invoke_method));
                return;
            }

            ec.Report.Error(407, loc, "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' return type",
                            return_type.GetSignatureForError(), member_name,
                            TypeManager.CSharpName(invoke_method.ReturnType), Delegate.FullDelegateDesc(invoke_method));
        }