New Posts New Posts RSS Feed: IDataErrorInfo
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

IDataErrorInfo

 Post Reply Post Reply
Author
Yaron View Drop Down
Newbie
Newbie


Joined: 19-Jun-2007
Posts: 16
Post Options Post Options   Quote Yaron Quote  Post ReplyReply Direct Link To This Post Topic: IDataErrorInfo
    Posted: 04-Jul-2007 at 10:15am
Simple question
 
The new version is implementing IDataErrorInfo, I am using the implementation described in the Verification tutorials (in the BaseEntity). I now get a VS warning that there is already an implementation in the Entity Base object.
My question is, How do I activate the built-in implementation or alternatively,supress the warnings?
 
Thanks
Back to Top
eileenv View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Jun-2007
Location: United States
Posts: 67
Post Options Post Options   Quote eileenv Quote  Post ReplyReply Direct Link To This Post Posted: 06-Jul-2007 at 12:40pm
  • The compilation warning occurs in VB only (not C#).

  • If you intend to reimplement the interface member, code in your derived class accesses the reimplemented member unless you use the MyBase keyword to access the base class implementation.

  • For information on hiding warnings or treating warnings as errors, see Configuring Warnings in Visual Basic.

     
Back to Top
Yaron View Drop Down
Newbie
Newbie


Joined: 19-Jun-2007
Posts: 16
Post Options Post Options   Quote Yaron Quote  Post ReplyReply Direct Link To This Post Posted: 06-Jul-2007 at 4:31pm

OK, First; what I am attempting to achieve is, displaying the verifier results on the UI (error bullets). so now I got 2 questions.

a: Can it be achieved with the new base implementation, if so then how?
b; Can you please refrase the middle part, I totaly lost you there.
Back to Top
eileenv View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Jun-2007
Location: United States
Posts: 67
Post Options Post Options   Quote eileenv Quote  Post ReplyReply Direct Link To This Post Posted: 06-Jul-2007 at 5:30pm
Even prior to the new base implementation, you should have been able to see verifier results displayed in UI with error bullets, if you were using .NET or DevExpress. The reason why IDataErrorInfo was implemented in 3.5.2.2 was to support Infragistics grid users.
 
I believe the Verification tutorial application implements its own IDataErrorInfo because it is doing extra things such as caching VerifierResults. Caching results is not implemented in the base implementation.
 
Rephrase of 2nd bullet: If you implement IDataErrorInfo in your own app, then the base implementation will be ignored unless you use the MyBase keyword to access it.


Edited by eileenv - 06-Jul-2007 at 5:30pm
Back to Top
Yaron View Drop Down
Newbie
Newbie


Joined: 19-Jun-2007
Posts: 16
Post Options Post Options   Quote Yaron Quote  Post ReplyReply Direct Link To This Post Posted: 07-Jul-2007 at 2:22am

OK, I looked at suppressing warnings, hardly the solution as it will suppress other warnings aswell which  I realy like. Is there a way to maybe 'force' the Base method to use the value returned from the cache, I also looked for the MyBase option, I don't seem to find the method which implement it (maybe a simple code example will save alot of questions).

Thanks


Edited by Yaron - 07-Jul-2007 at 2:24am
Back to Top
eileenv View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Jun-2007
Location: United States
Posts: 67
Post Options Post Options   Quote eileenv Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jul-2007 at 10:13am

In a forthcoming release, we will provide users the ability to override the base implementation of the IDataErrorInfo methods. This should make it easier for you to provide your own custom implementation without having to explicitly implement the IDataErrorInfo interface in your own class. Hope this helps. 

Back to Top
Yaron View Drop Down
Newbie
Newbie


Joined: 19-Jun-2007
Posts: 16
Post Options Post Options   Quote Yaron Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jul-2007 at 11:50am
Yes, Thanks. that will do it
Back to Top
SimonC View Drop Down
Newbie
Newbie


Joined: 14-Aug-2007
Posts: 3
Post Options Post Options   Quote SimonC Quote  Post ReplyReply Direct Link To This Post Posted: 14-Aug-2007 at 6:49am
Could you please point me to the doco on how to use the IDataErrorInfo features of IdeaBlade?
Back to Top
eileenv View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Jun-2007
Location: United States
Posts: 67
Post Options Post Options   Quote eileenv Quote  Post ReplyReply Direct Link To This Post Posted: 21-Aug-2007 at 3:26pm
IdeaBlade.Persistence.Entity provides 2 overridable methods if you want to replace the base implementation of the corresponding IDataErrorInfo methods. These are:

    /// <summary>
    /// Returns an error message indicating what is wrong with this entity.
    /// </summary>
    /// <returns>
    /// An error message indicating what is wrong with this entity.
    /// The default is an empty string ("").
    ///</returns>

    protected virtual String GetDataErrorInfo(); // the base implementation simply returns the RowError

    /// <summary>
    /// Returns error message for the property with the given name.
    /// </summary>
    /// <param name="pPropertyName">The name of the property whose error message to get.</param>
    /// <returns>
    /// The error message for the property. The default is an empty string ("").
    /// </returns>

    protected virtual String GetDataErrorInfo(String pPropertyName); // the base implementation simply returns the ColumnError
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down