NotifyDataErrorInfoInjector.AddHasErrors C# (CSharp) Method

AddHasErrors() public method

public AddHasErrors ( ) : void
return void
    void AddHasErrors()
    {
        var method = new MethodDefinition(NotifyDataErrorInfoFinder.InterfaceRef.FullName + ".get_HasErrors", MethodAttributes, TypeSystem.Boolean)
                         {
                             IsGetter = true,
                             IsPrivate = true,
                         };
        method.Overrides.Add(NotifyDataErrorInfoFinder.GetHasErrorsMethod);
        method.Body.Instructions.Append(
            Instruction.Create(OpCodes.Ldarg_0),
            Instruction.Create(OpCodes.Ldfld, ValidationTemplateField),
            Instruction.Create(OpCodes.Callvirt, NotifyDataErrorInfoFinder.GetHasErrorsMethod),
            Instruction.Create(OpCodes.Ret)
            );
        var property = new PropertyDefinition(NotifyDataErrorInfoFinder.InterfaceRef.FullName + ".HasErrors", PropertyAttributes.None, TypeSystem.Boolean)
                           {
                               GetMethod = method,
                           };
        TypeDefinition.Methods.Add(method);
        TypeDefinition.Properties.Add(property);
    }