8
I have a class:
public class Filter
{
public Filter (string name, string value)
{
Name = name;
Value = value;
}
public string Name {get; private set;}
public string Value {get; set;}
}
And a collection class:
public class FilterCollection : Collection<Filter>
{
// code elided
}
My component class:
public class MyComponent : Component
{
// ...
[Editor(typeof(FilterEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public FilterCollection Filters { get; set; }
// ...
}
The problem is that the collection is not serialized correctly by the designer.
I'm sure I'm missing something but I don't know what.
ADDITIONAL INFO
What I would like the designer.cs file to have is something along the following:
myComponent.Filters.Add (new Filter ("some name", "some value"));
myComponent.Filters.Add (new Filter ("other name", "other value"));
Is this feasible?