Xml [Serializable] ?

Dec 20, 2007 at 9:03 PM
Are there any plans to make the collections Xml Serializable friendly?
I've encounted this issue with the MultiDictionary object.

One of the obstacles...is the lack of default constructors. Here is one I tried to implement.

public MultiDictionary()
: this(true, EqualityComparer<TKey>.Default, EqualityComparer<TValue>.Default)
//I picked "true" for allow duplicates.....

I attempted this inclusion...and it helped.

What's getting me is the implementation of a ..Default Accessor Implementation..
I have to admit, my Generic(s) skills are average at best.

But something like this is apparently missing. Here is where I got stuck.

public Something?? thisint index

I tried a couple of different things...but either my lack of ability with generics or not discerning the concrete or base object correctly is hindering me.

Here is my test object ... which I can create...but I get the issues when I try to serialize it to Xml.

public class PowerCollectionMultiDictionaryTestWrapperForXml
private string _name = string.Empty;
public string Name
get { return _name; }
set { _name = value; }

private int _age = 0;
public int Age
get { return _age; }
set { _age = value; }

Wintellect.PowerCollections.MultiDictionary<Guid, Guid> _doubleGuidMultiDictionary = new Wintellect.PowerCollections.MultiDictionary<Guid, Guid>(true);

public Wintellect.PowerCollections.MultiDictionary<Guid, Guid> DoubleGuidMultiDictionary
get { return _doubleGuidMultiDictionary; }
set { _doubleGuidMultiDictionary = value; }

//and code to instantiate
PowerCollectionMultiDictionaryTestWrapperForXml pct = new PowerCollectionMultiDictionaryTestWrapperForXml();
pct.Name = "Sloan";
pct.Age = 35;
pct.DoubleGuidMultiDictionary.Add(Guid.NewGuid(), Guid.NewGuid());

I'll continue to work on it..but thought I'd at least list out the issue.

Since the code is:

public class MultiDictionary<TKey, TValue> : MultiDictionaryBase<TKey, TValue>, ICloneable

The intent definately looks to be "Make it Serializable".