Welcome Guest Search | Active Topics | Sign In | Register

Copy Constructors would be nice - I think Options
fxmaker
Posted: Thursday, July 19, 2007 8:45:05 PM
Rank: Member
Groups: Member

Joined: 6/11/2007
Posts: 15
I created a Dialog declaritively (in .aspx) and wanted to use it as a starting place for Dialogs I create programmatically.

I would like to say something like:

EO.Web.Dialog d = new EO.Web.Dialog(baseDialog);
//customize d here

but there is no copy constructor.

I tried using the serialization trick of:

MemoryStream m = new MemoryStream();
BinaryFormatter f = new BinaryFormatter();
f.Serialize(m, baseDialog);
m.Seek(0, SeekOrigin.Begin);
EO.Web.Dialog d = (EO.Web.Dialog)f.Deserialize(m);

but EO.Web is not marked as serializable.

Can you provide either
a) a code around
b) a copy constructor for each EO control
c) mark the assembly as serializable?

Thanks,

Perry
eo_support
Posted: Thursday, July 19, 2007 8:58:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi Perry,

You can't really it do it that way. :) ASP.NET Controls work very differently. The closest thing that you have is ControlPersister.PersistControl and ControlParser.ParseControl. But you would need an IDesignerHost for that. The easiest way for you would be saving the dialog as a UserControl and then use LoadControl to load it.

Thanks
fxmaker
Posted: Thursday, July 19, 2007 8:59:16 PM
Rank: Member
Groups: Member

Joined: 6/11/2007
Posts: 15
Thank you.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.