public IDictionary ToDictionary() {
IDictionary ht = new ListDictionary();
if( _local_ni != null ) {
ht["local"] = _local_ni.ToDictionary();
}
if( _remote_ni != null ) {
ht["remote"] = _remote_ni.ToDictionary();
}
if (_token != null) {
ht["token"] = _token.ToString();
}
if( _attributes != null ) {
foreach(DictionaryEntry de in _attributes) {
ht[ de.Key ] = de.Value;
}
}
return ht;
}
}
public void RoundTripHT(LinkMessage lm) { LinkMessage lm2 = new LinkMessage( lm.ToDictionary() ); Assert.AreEqual( lm, lm2, "LinkMessage HT Roundtrip" ); }