Apache.NMS.Util.PrimitiveMap.CheckValidType C# (CSharp) Method

CheckValidType() protected method

protected CheckValidType ( Object value ) : void
value Object
return void
        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);
                }
            }
        }