Problem persisting a collection within a property
- From: "razor" <rmyers@xxxxxxxxxxxxx>
- Date: 26 Dec 2005 13:42:52 -0800
I have created a Web control, and am trying to serialize a collection
that is a property of a class, and that class is a property of my
control. The following code is a simplified version of my control.
Can anyone tell me why the property and collection are not being
persisted as a property of the control?
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Collections;
using System.Web.UI.Design;
namespace Oxcera.Web.UI
{
[TypeConverter(typeof(ExpandableObjectConverter))]
public class MyToolbars
{
public MyToolbars()
{
}
private ToolbarCollection m_Top;
/// <summary>
/// Left property
/// </summary>
[Category("Toolbars"),
PersistenceMode(PersistenceMode.InnerProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
NotifyParentProperty(true),RefreshProperties(RefreshProperties.Repaint)]
public Oxcera.Web.UI.ToolbarCollection Top
{
get
{
if (m_Top == null) m_Top = new ToolbarCollection();
return m_Top;
}
}
}
public class MyControl : Control
{
public MyControl()
{
}
private MyToolbars m_Toolbars;
[Category("Misc"),
PersistenceMode(PersistenceMode.InnerProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public MyToolbars Toolbars
{
get
{
if (m_Toolbars == null) m_Toolbars = new MyToolbars();
return m_Toolbars;
}
}
}
}
.
- Prev by Date: How to strech the background image in a MDI Parent form?
- Next by Date: Re: GDI + Changes in 2005
- Previous by thread: How to strech the background image in a MDI Parent form?
- Next by thread: Downloading a text file from a Web Server
- Index(es):
Relevant Pages
|