Пример #1
0
 public SegParser(Segregator segregator, SegViewer viewer)
 {
     _segCommands = new SegCommands(segregator, viewer);
     _commands    = new Dictionary <string, Action <string[]> >()
     {
         { "+", _segCommands.AddFile },
         { "-", _segCommands.RemoveFile },
         { "#", _segCommands.ShowFiles }
     };
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
 public SegViewer(Segregator segregator)
 {
     _segregator = segregator;
 }
Пример #4
0
 public SegCommands(Segregator segregator, SegViewer viewer)
 {
     _segregator = segregator;
     _viewer     = viewer;
 }