public void ProcessSearchResult(LineValues lineValues) { foreach (var strategy in this.SearchStrategies) { switch (strategy) { case StrategyEnum.DistinctClientIP: { this.CalculateDistinctClientIPStrategy(lineValues.ClientIp); break; } case StrategyEnum.DistinctFqdnIP: { this.CalculateDistinctFqdnIPStrategy(lineValues.ClientIp, lineValues.FqdnIp); break; } case StrategyEnum.CountClientCalls: { this.CalculateCountClientCallsStrategy(lineValues.ClientIp); break; } default: throw new Exception("Insupported search strategy"); } } }
private void DisplayValue(string sVal) { try { ushort v = ushort.Parse(sVal); double cv = double.Parse(sVal); if (v < 0 || v > maxPhotoVal) { return; } SensorData data = new SensorData(DateTime.Now, v); photoDatas.Add(data); InsertDataToDB(data); TxtSensorCount.Text = photoDatas.Count.ToString(); PgbPhotoRegistor.Value = v; LblPhotoRegistor.Content = v.ToString(); string item = $"{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")}\t{v}"; if (AxisX.MaxValue < 200) { AxisX.MaxValue++; } RtbLog.AppendText($"{item}\n"); RtbLog.ScrollToEnd(); LineValues.Add(cv); DataContext = this; } catch (Exception ex) { RtbLog.AppendText($"Error : {ex.Message}\n"); RtbLog.ScrollToEnd(); //RtbLog.ScrollToCaret(); } }
public ConversationObject(string inputFilename) { string line; LineValues lineValues; System.IO.StreamReader file = new System.IO.StreamReader(inputFilename); while ((line = file.ReadLine()) != null) { lineValues = new LineValues(line); allPhraseLines.Add(lineValues); } }