New Posts New Posts RSS Feed: DelegateVerifier ...
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DelegateVerifier ...

 Post Reply Post Reply
Author
as123 View Drop Down
Newbie
Newbie


Joined: 27-Apr-2010
Posts: 30
Post Options Post Options   Quote as123 Quote  Post ReplyReply Direct Link To This Post Topic: DelegateVerifier ...
    Posted: 22-Nov-2010 at 11:26pm
      When creating a DelegateVerifier with only errorMessage and Condition, the verifier has the ApplicableType set  correctly (checked while debugging) in the trigger link after doing AddTrigger. However, when using the constructor with 4 parameters, the trigger is added successfuly, but the TriggerItem.Type is set to null. Due to this, I believe, the validation is not fired on SetItem. 

      Can someone tell me how to resolve this? Do I need to set anything else before creating DelegateVerifier with 4 parameters so that the Applicable Type is set correctly?

Thanks

----------------------------------------------------------------------------------------------------------------------------------
Sample code:

      string errorMessage;
           
// works ok
    DelegateVerifier<Employee> v = new DelegateVerifier<Employee>(errorMessage, Condition); //Condition is a method name

// does not work
    //DelegateVerifier<Employee> v = new DelegateVerifier<Employee>(verifierArgs, errorMessage, null, Condition);                                                                             //veriferArgs - created using the default constructor and its Tag set to a custom object;

     v.AddTriggers("ID");  
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 29-Nov-2010 at 5:10pm
Hi as123;

To use the DelegateVerifier constructor with the 4 parameters, you can use the following:

var verifierArgs = new DelegateVerifierArgs<Employee>(errorMessage, null, Condition);
DelegateVerifier<Employee> v = new DelegateVerifier<Employee>(verifierArgs, errorMessage, null, Condition);

If that sounds redundant, then you can also use:

DelegateVerifier<Employee> v = new DelegateVerifier<Employee>(verifierArgs);
Back to Top
as123 View Drop Down
Newbie
Newbie


Joined: 27-Apr-2010
Posts: 30
Post Options Post Options   Quote as123 Quote  Post ReplyReply Direct Link To This Post Posted: 30-Nov-2010 at 12:48pm
         Thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down