YAMP.ObjectExtensions.ToValue C# (CSharp) Method

ToValue() public static method

public static ToValue ( this s ) : Value
s this
return Value
        public static Value ToValue(this Object s)
        {
            if (s is Value)
            {
                return (Value)s;
            }
            else if (s is Double || s is Int32 || s is Single || s is Int64)
            {
                return new ScalarValue((Double)s);
            }
            else if (s is String || s is Char)
            {
                return new StringValue(s.ToString());
            }

            return null;
        }
ObjectExtensions