public Parser4(string _AdtFile, string _SampleId, int _ProjectDataCollectionId, int _ProjectId, string _InstrumentName) { AdtFile = _AdtFile; SampleId = _SampleId; ProjectDataCollectionId = _ProjectDataCollectionId; ProjectId = _ProjectId; t = new OutputTables(_SampleId, _ProjectDataCollectionId, _ProjectId, _InstrumentName); //do some initialization dt = new DataTable(); rowField = -1; // current row of the field table rowFieldRemark = -1; BlaiseSession = 0; //actually not blaise session, real session UserPageOrder = 0; PageIndex = 0; EnterFieldFullList = new List <string>(); NewSession1stEnterField = true; EnterFieldLeaveMatched = new List <int>(); FieldPrepopulated = new List <string>(); //for uri related Uri = ""; UriOther = ""; UriTSCamtasiaFound = false; UriNotCamtasia_Found = false; UriNotCamtasia_Recorded = false; UriTSCamtasia_Recorded = false; //for Page related rowPage = -1; NewPage = false; PageFieldEntered = new List <string>(); EnterPageFullList = new List <int>(); PageFieldEntered = new List <string>(); PagePriorAction = new List <string>(); }
/// <summary> /// find the timestamp for one line /// </summary> /// <param name="s"></param> /// <returns></returns> private DateTime FindTime(string s) { DateTime t; t = DateTime.MinValue; var p1 = s.IndexOf("\""); //find first " if (p1 >= 0) { var p2 = s.IndexOf("\"", p1 + 1); // if (p2 > p1 + 1) { var stime = s.Substring(p1 + 1, p2 - p1 - 1); // Console.WriteLine(stime); var culture = new CultureInfo("en-US"); if (DateTime.TryParseExact(stime, "MM/dd/yyyy hh:mm:ss:fff tt", culture, DateTimeStyles.None, out t) || DateTime.TryParseExact(stime, "MM/dd/yyyy h:mm:ss:fff tt", culture, DateTimeStyles.None, out t) || DateTime.TryParseExact(stime, "MM/d/yyyy hh:mm:ss:fff tt", culture, DateTimeStyles.None, out t) || DateTime.TryParseExact(stime, "MM/d/yyyy h:mm:ss:fff tt", culture, DateTimeStyles.None, out t) || DateTime.TryParseExact(stime, "M/dd/yyyy hh:mm:ss:fff tt", culture, DateTimeStyles.None, out t) || DateTime.TryParseExact(stime, "M/dd/yyyy h:mm:ss:fff tt", culture, DateTimeStyles.None, out t) || DateTime.TryParseExact(stime, "M/d/yyyy hh:mm:ss:fff tt", culture, DateTimeStyles.None, out t) || DateTime.TryParseExact(stime, "M/d/yyyy h:mm:ss:fff tt", culture, DateTimeStyles.None, out t)) { return(t); } } } Log.WriteError(Log.path() + " Wrong Datetime format: " + s); return(t); }