/// <summary>
/// Reads map from input
/// </summary>
/// <param name="abstractHessianInput">Input stream</param>
/// <returns>Read map or null</returns>
public override object ReadMap(AbstractHessianInput abstractHessianInput)
{
IDictionary dictionary = null;
if ((m_type == null) || (m_type.IsInterface && typeof(IDictionary).IsAssignableFrom(m_type)))
{
dictionary = new Dictionary <Object, Object>();
}
else if (m_type.Equals(typeof(Dictionary <Object, Object>)))
{
dictionary = new Dictionary <Object, Object>();
}
else
{
//dictionary = (IDictionary)Activator.CreateInstance(m_type);
dictionary = new Dictionary <Object, Object>();
}
abstractHessianInput.AddRef(dictionary);
while (!abstractHessianInput.IsEnd())
{
Object key = abstractHessianInput.ReadObject();
Object value = abstractHessianInput.ReadObject();
if (!dictionary.Contains(key))
{
dictionary.Add(key, value);
}
}
abstractHessianInput.ReadEnd();
return(dictionary);
}