public SectionParser(CommandLineLogger logger, ExtractFileInfo fileInfo, bool isPreservation, string preservationPrefix, ParserVersionEnum version) { ContainsLocationData = false; Logger = logger; FileInfo = fileInfo; SourceFile = FileInfo.OriginalFile_Path; SectionName = Path.GetFileNameWithoutExtension(FileInfo.File_Name); List <string> sectionStrings = new List <string>(); if (SectionName.Contains("_")) { sectionStrings = SectionName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries).ToList(); } else if (SectionName.Contains("_")) { sectionStrings = SectionName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries).ToList(); } if (!sectionStrings.Any()) { sectionStrings.Add(SectionName); } List <string> sectionStringsUpper = new List <string>(); string temp = string.Empty; foreach (string s in sectionStrings) { sectionStringsUpper.Add(s.First().ToString().ToUpper() + s.Substring(1)); } IsPreservation = isPreservation; PreservationPrefix = preservationPrefix; ParserVersion = version; MainTableName = string.Join("", sectionStringsUpper); if (isPreservation) { MainTableName = PreservationPrefix + "_" + MainTableName; } DisplaySectionName = string.Join(" ", sectionStringsUpper); LoadHtml(); ProcessHTML(); }
/// <summary> /// Wins the load. /// </summary> private void WinLoad() { WinActivated(); IsSavebtnEnable = true; StatNameColSpan = 2; StatNameSearch = Visibility.Visible; Title = "Statistics Properties"; FilterSource = new List <string>(); FilterSource.Add("None"); foreach (string Filter in Settings.GetInstance().DictServerFilters.Keys) { if (!FilterSource.Contains(Filter)) { FilterSource.Add(Filter); } } FormatSource = new List <string>(); foreach (string Format in Settings.GetInstance().DictStatFormats.Keys) { if (!FormatSource.Contains(Format)) { FormatSource.Add(Format + " " + Settings.GetInstance().DictStatFormats[Format]); } } if (Settings.GetInstance().DictExistingApplicationStats.ContainsKey(Section)) { Dictionary <string, string> statProperties = new Dictionary <string, string>(); statProperties = Settings.GetInstance().DictExistingApplicationStats[Section]; SelectedFilter = statProperties[StatisticsEnum.StatProperties.Filter.ToString()]; SelectedFormat = statProperties[StatisticsEnum.StatProperties.Format.ToString()] + " " + Settings.GetInstance().DictStatFormats[statProperties[StatisticsEnum.StatProperties.Format.ToString()]]; StatisticsColor = (System.Windows.Media.Color)ColorConverter.ConvertFromString(statProperties[StatisticsEnum.StatProperties.Color1.ToString()]); ThresholdColor1 = (System.Windows.Media.Color)ColorConverter.ConvertFromString(statProperties[StatisticsEnum.StatProperties.Color2.ToString()]); ThresholdColor2 = (System.Windows.Media.Color)ColorConverter.ConvertFromString(statProperties[StatisticsEnum.StatProperties.Color3.ToString()]); } else { StatisticsColor = (System.Windows.Media.Color)ColorConverter.ConvertFromString("Black"); ThresholdColor1 = (System.Windows.Media.Color)ColorConverter.ConvertFromString("Green"); ThresholdColor2 = (System.Windows.Media.Color)ColorConverter.ConvertFromString("Red"); } Sections = new System.Collections.Generic.List <string>(); Sections.Add(StatisticsEnum.SectionName.acd.ToString()); Sections.Add(StatisticsEnum.SectionName.agent.ToString()); Sections.Add(StatisticsEnum.SectionName.group.ToString()); Sections.Add(StatisticsEnum.SectionName.dn.ToString()); Sections.Add(StatisticsEnum.SectionName.vq.ToString()); if (!string.IsNullOrEmpty(SectionName)) { string[] SectionTitle = SectionName.Split('-'); if (Sections.Contains(SectionTitle[0].ToString().ToLower())) { SelectedSection = SectionTitle[0].ToString().ToLower(); SectionName = SectionName.Replace(SectionTitle[0].ToString().ToLower() + "-", ""); } SectionChangedEvent(SelectedSection); } else { switch (objStatSupport.GetSupportedObject(Section)) { case "Agent": SelectedSection = StatisticsEnum.SectionName.agent.ToString(); SectionChangedEvent(StatisticsEnum.SectionName.agent.ToString()); break; case "AgentGroup": SelectedSection = StatisticsEnum.SectionName.group.ToString(); SectionChangedEvent(StatisticsEnum.SectionName.group.ToString()); break; case "Queue": SelectedSection = StatisticsEnum.SectionName.acd.ToString(); SectionChangedEvent(StatisticsEnum.SectionName.acd.ToString()); break; case "GroupQueus": SelectedSection = StatisticsEnum.SectionName.dn.ToString(); SectionChangedEvent(StatisticsEnum.SectionName.dn.ToString()); break; case "RoutePoint": SelectedSection = StatisticsEnum.SectionName.vq.ToString(); SectionChangedEvent(StatisticsEnum.SectionName.vq.ToString()); break; } } if (SelectedFilter == string.Empty || SelectedFilter == "") { SelectedFilter = "None"; } if (string.IsNullOrEmpty(SelectedFilter)) { SelectedFilter = FilterSource[0]; } if (string.IsNullOrEmpty(SelectedFormat)) { SelectedFormat = FormatSource[0]; Settings.GetInstance().SelectedFormat = SelectedFormat; } else { Settings.GetInstance().SelectedFormat = SelectedFormat; } KeyToDifferentiateStyles = "1"; Settings.GetInstance().TValue1 = Threshold1; Settings.GetInstance().TValue2 = Threshold2; }