wasSharp

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 38  →  ?path2? @ 39
/Collections/Generic/SerializableDictionary.cs
@@ -72,41 +72,12 @@
}
}
 
/// <summary>
/// Deep-clones the serializable dictionary.
/// </summary>
/// <returns>a deep clone of the original dictionary</returns>
public SerializableDictionary<TKey, TValue> Clone()
{
SerializableDictionary<TKey, TValue> clone;
try
{
using (var memoryStream = new MemoryStream())
{
new XmlSerializer(
typeof(SerializableDictionary<TKey, TValue>), new XmlRootAttribute(DictionaryNodeName))
.Serialize(memoryStream, this);
memoryStream.Position = 0;
clone = (SerializableDictionary<TKey, TValue>)
new XmlSerializer(
typeof(SerializableDictionary<TKey, TValue>), new XmlRootAttribute(DictionaryNodeName))
.Deserialize(memoryStream);
}
}
/* cloning failed so return an empty dictionary */
catch (Exception)
{
clone = new SerializableDictionary<TKey, TValue>();
}
return clone;
}
 
#region Constants
 
public string DictionaryNodeName { get; set; } = "Dictionary";
public string ItemNodeName { get; set; } = "Item";
public string KeyNodeName { get; set; } = "Key";
public string ValueNodeName { get; set; } = "Value";
public readonly string DictionaryNodeName = @"Dictionary";
public readonly string ItemNodeName = @"Item";
public readonly string KeyNodeName = @"Key";
public readonly string ValueNodeName = @"Value";
 
#endregion Constants