private void Filter_Click(object sender, RoutedEventArgs e) { int starthour = (int)cmbhrstart.SelectedValue; int startminute = (int)cmbminstart.SelectedValue; int endhour = (int)cmbhrend.SelectedValue; int endminute = (int)cmbminend.SelectedValue; if (collection.Date == "Please Select a log file") { MessageBox.Show("please load a log file first"); return; } DateTime d = DateTime.Parse(collection.Date); DateTime s = new DateTime(d.Year, d.Month, d.Day, starthour, startminute, 0); DateTime en = new DateTime(d.Year, d.Month, d.Day, endhour, endminute, 59); if (s >= en) { MessageBox.Show("start time is greater then end time"); return; } List <LogFileItemType> list = new List <LogFileItemType>(); foreach (CheckBox item in PannelChecker.Children) { if (item.IsChecked == true) { string text = item.Content.ToString().Split()[0]; LogFileItemType MyStatus = (LogFileItemType)Enum.Parse(typeof(LogFileItemType), text); list.Add(MyStatus); } } collection.FilterLog(s, en, list); }
public LogFileItem(string p1, string p2, string p3, string p4) { _url = p2.Split('?')[1]; string[] x = p3.Split(); string[] temp = x[0].Split('/'); string time = temp[1] + "/" + temp[0] + "/" + temp[2] + " " + x[1] + " " + x[2]; _time = DateTime.Parse(time); _type = GetLogFileItemType(); _newtime = _time; }
private void AddCounter() { if (firsttime) { foreach (CheckBox item in PannelChecker.Children) { LogFileItemType type = (LogFileItemType)Enum.Parse(typeof(LogFileItemType), item.Content.ToString(), true); item.Content = type.ToString() + " (" + collection.LogData.Count(x => x._type == type) + ")"; } TotalCount.Visibility = System.Windows.Visibility.Visible; TotalCount.Text = "------------------------------\nTotal Count: " + collection.LogData.Count; firsttime = false; } TotalVMSCount.Text = "Total VMS items: " + collection.VMSMessagesData.Count; TotaTravelTimelCount.Text = "Total Travel Time items: " + collection.TravelTimeData.Count; TotalDetectorsCount.Text = "Total Detectors items: " + collection.TunnelDetectorData.Count; }