I have a base class for some kind of user controls, and in that base class and in its inherited classes I want to store some properties. I use
protected override object SaveControlState()
protected override void LoadControlState(object savedState)
methods to save or load my custom values. Since I can work only with 1 parameter of type object, I have to use some kind of list if I want to work with more than 1 variable.
I tried to do it with
[Serializable]
public class ControlSate : Dictionary<string, object>, ISerializable
{
void ISerializable.GetObjectData(SerializationInfo info,
StreamingContext context)
{
}
public ControlSate(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
public ControlSate()
: base()
{
}
}
but it didn't work, and looking for a solution I have read that Dictionary is not serializable.
So, my question is what type should I use to work with a set of values in user control's state?