Re: Is Dirty
Peter Osucha <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
That isn't quite as efficient though (I don't think). If a user changes something and then changes it back, the 'IsDirty' would still be true even though technically, nothing has changed. I haven't done the serializing thing to check for IsDirty but it seems solid. -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Phil Sayers Sent: Thursday, May 17, 2007 10:29 AM To: [email protected] Subject: Re: [DOTNET-WINFORMS] Is Dirty inside your entity, or even in a common base class... add a property, and a backing field Public ReadOnly prperty IsDirty get return _IsDirty end get in all your public property Set blocks add "_isDirty = True" -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]]On Behalf Of Brady Kelly Sent: Thursday, May 17, 2007 10:25 AM To: [email protected] Subject: [DOTNET-WINFORMS] Is Dirty I'm doing a quick and dirty prototype app, with one simple detail edit screen, so I've used simple own code to transfer values between controls and data entity, deferring properly implementing data binding at a later stage[1]. Now I want to know if the edited entity is 'dirty'. My first reaction is to serialise it on starting my edit, and then when closing the form, and compare the two. How do the experts here feel about this?