Click to See Complete Forum and Search --> : designer serialization


izzetbaysal
September 26th, 2008, 08:13 AM
Hi all,
i have a form with 3 textboxes and i have a class named user which has 3 members such as name, surname and age. I use the form to get user values design time and i want to serialize these values into the form designer. I can show the form at design time by using a ComponentDesigner. Here is a part of my code.


public class MyDesigner : ComponentDesigner
{
MyComponent CurrentController
{
get { return (MyComponent)this.Component; }
}
private DesignerVerbCollection actions;
public override DesignerVerbCollection Verbs
{
get
{
if(actions == null)
{
actions = new DesignerVerbCollection();
actions.Add(new DesignerVerb("EditorForm", new EventHandler(ChangeDisplay)));

}
return actions;
}
}

}

void ChangeDisplay(object sender, EventArgs e)
{
EditorForm editor = new EditorForm(this);
editor.ShowDialog();
}
}


I also have a collection class which i hold user class members. What i need is to serialize the collection into designer at design time. I can serialize the values by using the collectioneditor but can't do that via my editor form.
Any help would be greatly appreciated.