示例#1
0
        public static TimeSpan?ConvertToTimeSpan(this IQFeedLevel1Column column, string value)
        {
            if (column == null)
            {
                throw new ArgumentNullException("column");
            }

            // http://stocksharp.com/forum/yaf_postsm32150_API-4-2-2-24--InvalidCastException.aspx#post32150
            if (value.ContainsIgnoreCase("99:99:99"))
            {
                return(null);
            }

            return(value.TryToTimeSpan(column.Format));
        }
示例#2
0
        public static object Convert(this IQFeedLevel1Column column, string value)
        {
            if (column == null)
            {
                throw new ArgumentNullException("column");
            }

            if (value.IsEmpty())
            {
                return(null);
            }

            var convValue = value.To(column.Type);

            if (column.Type.IsNumeric() && convValue.To <decimal>() == 0)
            {
                convValue = null;
            }

            return(convValue);
        }