NotifyDataErrorInfoInjector.GetAdd C# (CSharp) Method

GetAdd() private method

private GetAdd ( ) : MethodDefinition
return MethodDefinition
    MethodDefinition GetAdd()
    {
        var add = new MethodDefinition(NotifyDataErrorInfoFinder.InterfaceRef.FullName + ".add_ErrorsChanged", MethodAttributes, TypeSystem.Void)
                      {
                          SemanticsAttributes = MethodSemanticsAttributes.AddOn,
                          IsPrivate = true,
                      };
        add.Overrides.Add(NotifyDataErrorInfoFinder.ErrorsChangedAddMethod);
        add.Parameters.Add(new ParameterDefinition(NotifyDataErrorInfoFinder.ErrorsChangedEventType));
        add.Body.Instructions.Append(
            Instruction.Create(OpCodes.Ldarg_0),
            Instruction.Create(OpCodes.Ldfld, ValidationTemplateField),
            Instruction.Create(OpCodes.Ldarg_1),
            Instruction.Create(OpCodes.Callvirt, NotifyDataErrorInfoFinder.ErrorsChangedAddMethod),
            Instruction.Create(OpCodes.Ret));
        TypeDefinition.Methods.Add(add);
        return add;
    }