protected virtual void CheckValidType(Object value)
{
if(value != null && !(value is IList) && !(value is IDictionary))
{
Type type = value.GetType();
if(type.IsInstanceOfType(typeof(Object)) ||
(!type.IsPrimitive && !type.IsValueType && !type.IsAssignableFrom(typeof(string))))
{
throw new NMSException("Invalid type: " + type.Name + " for value: " + value);
}
}
}