protected BasePipeLine(ICollector collector, IOutputer outputer, List <IProcessor> processors, TransmitModel model) { this.processors = processors; this.collector = collector; this.outputer = outputer; this.model = model; }
public override void Add(string dirPath, IOutputer outputer) { if (!Directory.Exists(dirPath)) { throw new InvalidOperationException($"invalid directory: <\"{dirPath}\">."); } base.Add(Path.GetFullPath(dirPath), outputer); }
public virtual void Remove(string value, IOutputer outputer) { var exists = this.Paths.FirstOrDefault(z => Comparer.Equals(z, value)); if (exists == null) { throw new InvalidOperationException($"value not exists: <{value}>"); } this.Paths.Remove(exists); this.Save(); outputer.WriteLine(OutputLevel.Normal, $"Removed <{value}> from {this._target} envvar <{this._name}>."); }
public virtual void Add(string value, IOutputer outputer) { var exists = this.Paths.FirstOrDefault(z => Comparer.Equals(z, value)); if (exists != null) { throw new InvalidOperationException($"exists value: <{exists}>"); } this.Paths.Add(value); this.Save(); outputer.WriteLine(OutputLevel.Normal, $"Added <{value}> into {this._target} envvar <{this._name}>."); }
public void Map(string dirPath, IOutputer outputer) { if (!Directory.Exists(dirPath)) { throw new InvalidOperationException($"invalid directory: <\"{dirPath}\">."); } dirPath = Path.GetFullPath(dirPath); var lastChar = dirPath[dirPath.Length - 1]; if (lastChar == Path.DirectorySeparatorChar || lastChar == Path.AltDirectorySeparatorChar) { dirPath = dirPath.Substring(0, dirPath.Length - 1); } var dirPath2 = dirPath + Path.DirectorySeparatorChar; var removed = new HashSet <string>(StringComparer.OrdinalIgnoreCase); var added = new List <string>(); this.Paths.RemoveAll(z => { if (z.Equals(dirPath, StringComparison.OrdinalIgnoreCase) || z.StartsWith(dirPath2, StringComparison.OrdinalIgnoreCase)) { removed.Add(z); return(true); } return(false); }); foreach (var item in Directory.GetDirectories(dirPath)) { if (!removed.Remove(item)) { added.Add(item); } this.Paths.Add(item); } outputer.WriteLine(OutputLevel.Normal, $"Added ({added.Count}):"); foreach (var item in added) { outputer.WriteLine(OutputLevel.Normal, $" {item}"); } outputer.WriteLine(OutputLevel.Normal, $"Removed ({removed.Count}):"); foreach (var item in removed) { outputer.WriteLine(OutputLevel.Normal, $" {item}"); } this.Save(); }
public UmiMiddleware(RequestDelegate next, UmiMiddlewareOptions options, JsonOutputer jsonOutputer, HtmlOutputer htmlOutputer, AssetOutputer assetOutputer) { this.next = next; this.options = options; this.jsonOutputer = jsonOutputer; this.jsonOutputer.SetOptions(this.options); this.htmlOutputer = htmlOutputer; this.htmlOutputer.SetOptions(this.options); this.assetOutputer = assetOutputer; this.assetOutputer.SetOptions(this.options); }
public LinesPipeLine(ICollector collector, IOutputer outputer, List <IProcessor> processors) : base(collector, outputer, processors, TransmitModel.LINES) { }
public NotEvenRowsTableFilter(IOutputer outputer) { Outputer = outputer; }
public IBuilder SetOutputer(IOutputer outputer) { this.outputer = outputer; return(this); }
public void Sort(IOutputer outputer) { this.Paths.Sort(); this.Save(); outputer.WriteLine(OutputLevel.Normal, $"Sorted {this._target} envvar <{this._name}>."); }
public void List(IOutputer outputer) { outputer.WriteLine(OutputLevel.Normal, this.ToString()); }
public UsageDrawer(IOutputer outputer) { this._outputer = outputer; }
public override void Remove(string dirPath, IOutputer outputer) { base.Remove(Path.GetFullPath(dirPath), outputer); }