private static IEnumerable <Selection> ReadSelectionFromOptions(SelectorOptions options) { ITimestampStringConverter timestampConverter = TimestampStringConverterResolver.Default.Resolve(options.TimestampFormat); var selection = Selection.Parse(options.FromTimestamp, options.ToTimestamp, timestampConverter); return(new[] { selection }); }
private static void Configure(FilterContext context, SelectorOptions options) { // read from options or config file var selections = Enumerable.Empty <Selection>(); if (String.IsNullOrWhiteSpace(options.ConfigFilePath)) { selections = ReadSelectionFromOptions(options); } else { selections = ReadSelectionsFromConfigFile(context, options.ConfigFilePath); } if (selections.Any()) { var observers = CreateObserversForSelections(selections, options).ToList(); observers.ForEach(context.Observers.Add); context.GlobalSelection = Selection.Union(selections); } }
private static object CreateObserversForSelections(IEnumerable <Selection> selections, SelectorOptions options) { var output = UXI.Filters.Common.FileHelper.DescribeOutput( options.OutputFilePath, options.OutputFileFormat, options.DefaultOutputFileFormat, typeof(TimestampedDataPayload), Console.Out ); var observer = new FilteringObserver(selection, output); }