Beispiel #1
0
        private IAggregator CreateAggregator(AggregatorType aggregatorType, int channelId, string instrumentName)
        {
            IDataWriter dataWriter;

            switch (_dataWriterType)
            {
            case DataWriterType.BinaryFile:
                dataWriter = new FileDataWriter(instrumentName, aggregatorType);
                break;

            case DataWriterType.Console:
                dataWriter = new ConsoleDataWriter(aggregatorType);
                break;

            default:
                throw new ArgumentException(nameof(_dataWriterType));
            }

            switch (aggregatorType)
            {
            case AggregatorType.Books:
                return(new BookAggregator(dataWriter, channelId, instrumentName));

            case AggregatorType.RawBooks:
                return(new RawBookAggregator(dataWriter, channelId, instrumentName));

            default:
                throw new ArgumentException(nameof(aggregatorType));
            }
        }
        public static void Main()
        {
            var commandParser = new CommandParser();
            var studentSystem = new StudentSystem();
            var dataReader    = new ConsoleDataReader();
            var dataWriter    = new ConsoleDataWriter();
            var engine        = new Engine(commandParser, studentSystem, dataReader, dataWriter);

            engine.Run();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Storage Master");
            IReader reader        = new ConsoleDataReader();
            IWriter writer        = new ConsoleDataWriter();
            Engine  StorageEngine = new Engine(reader, writer);

            StorageEngine.Run();
            Console.ReadLine();
        }
Beispiel #4
0
        public static void Main(string[] args)
        {
            var productFactory = new ProductFactory();
            var storageFactory = new StorageFactory();

            StorageMaster.Core.StorageMaster storageMaster = new StorageMaster.Core.StorageMaster(productFactory, storageFactory);
            var consoleDataReader = new ConsoleDataReader();
            var consoleDataWriter = new ConsoleDataWriter();

            var engine = new Engine(storageMaster, consoleDataReader, consoleDataWriter);

            engine.Run();
        }
        public static void Main(string[] args)
        {
            var hotel            = new Hotel();
            var animalFactory    = new AnimalFactory();
            var procedureFactory = new ProcedureFactory();

            AnimalCentree animalCentre = new AnimalCentree(hotel, animalFactory, procedureFactory);

            var commandParser = new CommandParser();
            var dataWriter    = new ConsoleDataWriter();
            var dataReader    = new ConsoleDataReader();

            var engine = new Engine(
                animalCentre,
                commandParser,
                dataReader,
                dataWriter);

            engine.Run();
        }
        public static void Main()
        {
            var pilotFactory   = new PilotFactory();
            var tankFactory    = new TankFactory();
            var fighterFactory = new FighterFactory();

            var machinesManager = new MachinesManager(
                pilotFactory,
                tankFactory,
                fighterFactory);

            var commandParser = new CommandParser();
            var dataReader    = new ConsoleDataReader();
            var dataWriter    = new ConsoleDataWriter();

            var engine = new Engine(
                machinesManager,
                commandParser,
                dataReader,
                dataWriter);

            engine.Run();
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            var atm = new Atm();

            var dataReader = new ConsoleDataReader();
            var dataWriter = new ConsoleDataWriter();
            var dataClear  = new ConsoleClear();
            var options    = new Options();
            var menu       = new Menu(dataReader, dataWriter, dataClear);

            Console.Write(Constants.ENTER_START_SUM_MESSAGE);
            var startSum = int.Parse(Console.ReadLine());

            atm.StartSum     = startSum;
            atm.Menu         = menu;
            atm.Menu.Options = options;

            bool showMenu = true;

            while (showMenu)
            {
                showMenu = atm.Menu.MainMenu(ref startSum);
            }
        }