public SegParser(Segregator segregator, SegViewer viewer) { _segCommands = new SegCommands(segregator, viewer); _commands = new Dictionary <string, Action <string[]> >() { { "+", _segCommands.AddFile }, { "-", _segCommands.RemoveFile }, { "#", _segCommands.ShowFiles } }; }
private static void RunSegregator() { Segregator segregator = new Segregator(); SegViewer viewer = new SegViewer(segregator); SegParser parser = new SegParser(segregator, viewer); while (true) { var line = Console.ReadLine(); if (line == "q" || line == "Q") { break; } parser.ParseCommand(line); } }
public SegViewer(Segregator segregator) { _segregator = segregator; }
public SegCommands(Segregator segregator, SegViewer viewer) { _segregator = segregator; _viewer = viewer; }