NotifyDataErrorInfoInjector.AddGetErrors C# (CSharp) Method

AddGetErrors() public method

public AddGetErrors ( ) : void
return void
    void AddGetErrors()
    {
        var method = new MethodDefinition(NotifyDataErrorInfoFinder.InterfaceRef.FullName + ".GetErrors", MethodAttributes, NotifyDataErrorInfoFinder.GetErrorsMethodRef.ReturnType)
                         {
                             IsPrivate = true,
                         };
        method.Overrides.Add(NotifyDataErrorInfoFinder.GetErrorsMethodRef);

        method.Parameters.Add(new ParameterDefinition(TypeSystem.String));

        method.Body.Instructions.Append(
            Instruction.Create(OpCodes.Ldarg_0),
            Instruction.Create(OpCodes.Ldfld, ValidationTemplateField),
            Instruction.Create(OpCodes.Ldarg_1),
            Instruction.Create(OpCodes.Callvirt, NotifyDataErrorInfoFinder.GetErrorsMethodRef),
            Instruction.Create(OpCodes.Ret)
            );
        TypeDefinition.Methods.Add(method);
    }