StrataFrame Forum

Inherited Browse Dialog problem

http://forum.strataframe.net/Topic14357.aspx

By Paul Chase - 2/13/2008

Hi ,

My browse dialogs inherit's from my base class browse dialog that inherits from the SF browse dialog. Serialization doesn't seem to work anymore. Now if i make any change to my browse dialog via the property every single stitch of code the was serialized in the init component is "smoked"... and obviusly the property i meant to change is not persisted either. Before I start ripping into this did something change since 1.60 that may cause this?

Thanks

By Trent L. Taylor - 2/13/2008

Before I start ripping into this did something change since 1.60 that may cause this?

No.  This has nothing to do with the BrowseDialog class, but rather the .NET serialziation designer.  In fact, we take this same approach for all of our browse dialogs in our medical app (and I even created a new one this morning).  One thing that helps, though, is to set the class structure up like a form or user control with the designer file:

By Paul Chase - 2/13/2008

I see what is going on. Because my browse dialog is inheriting from my base browse dialog which then inherits from SF.BrowseDialog the IsInheritedBrowseDialog fuction is returning false,

overriding that function and everythign is happy.

Paul

By Paul Chase - 2/13/2008

I am not sure why IsSubclassof (BrowseDialog) returns false though. I would think that because it ultimatly is a sublclass of browsedialog it should work shouldnt it?

I am set up like this/

Public Class AL_BrowseDialog'--My Base Class Browse Dialog

Inherits MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialog

and

Namespace BrowseDialogs

Public Class CustomerBrowseDialog

Inherits Base.BrowseDialogs.AL_BrowseDialog

 No big deal as overriding the function works but just currious

Paul

By Trent L. Taylor - 2/13/2008

I would think that because it ultimatly is a sublclass of browsedialog it should work shouldnt it?

No....in fact, I spent a lot of time yesterday trying to get a generic type to work with the ITypeDiscovery interface and the IsSubClassOf.  Since you are two deep, the IsSubClassOf may not work since your browsedialog actually is a direct subclass of your base browsedialog.  You can make it work by "jacking" with some of the options and you may even play with the Type.ReflectionOnlyGetType to see if it returns differently.  But this can get confusing with there are multiple inheritances.

By Paul Chase - 2/13/2008

Yeah that's about what I figured. Thanks for the info.. I am sure I will run into that again