public void NewRowVal(int pos, string val)
        {
            var thisList = new List <Type>();
            var ss       = new HistorySnapshot(pos, val, hasSnapshots ? getCurrentSnapshot : null);

            ss.CurrentNullRows = string.IsNullOrEmpty(val);

            foreach (KnownType kt in KnownList)
            {
                Type thisType = ss.CurrentNullRows ? kt.NullableType : kt.RegularType;
                if (val.IsConvertibleTo(thisType))
                {
                    if (kt.TypeName == "datetime")
                    {
                        if (!DateCheck(ss.CurrentValue))
                        {
                            continue;
                        }
                    }
                    ss.CurrentTypeList.Add(thisType);
                }
            }

            ss.Resolve();

            Snapshots.Add(ss);
        }
Beispiel #2
0
 public HistorySnapshot(int pos, string val, HistorySnapshot prevSnapshot = null)
 {
     KnownTypesLookup = new KnownTypes();
     CurrentPos       = pos;
     CurrentValue     = val;
     RecordList       = new List <HistoryRecord>()
     {
         new HistoryRecord()
         {
             Name = "start", NullRows = (prevSnapshot == null) ? false : prevSnapshot.EndNullRows, TypeList = (prevSnapshot == null) ? new List <Type>() : prevSnapshot.EndTypeList
         },
         new HistoryRecord()
         {
             Name = "current", NullRows = false, TypeList = new List <Type>()
         },
         new HistoryRecord()
         {
             Name = "end", NullRows = false, TypeList = new List <Type>()
         },
     };
 }