Ejemplo n.º 1
0
        public ATMSystem(IATMFactory factory, ITransponderReceiver transponderReceiver)
        {
            //Calling factory methods
            receiver           = transponderReceiver;
            _airSpace          = factory.CreateAirSpace();
            _condition         = factory.CreateCondition();
            _consolePrinter    = factory.CreateConsolePrinter();
            _logger            = factory.CreateLogger();
            _separationChecker = factory.CreateSeparationChecker();

            //Subscribing to events
            this.receiver.TransponderDataReady += ReceiverOnTransponderReady;
            this.SeparationLogDataReady        += _logger.SeparationLogDataHandler;
            this.ConsoleSeparationDataReady    += _consolePrinter.ConsoleSeparationDataHandler;
        }
Ejemplo n.º 2
0
        public static void PrintValidCode(IConsolePrinter consolePrinter, TerminalCode terminalCode, ConsoleColor overridingColor = default)
        {
            FormatCodeColor(consolePrinter, terminalCode.Code1, overridingColor);
            consolePrinter.PrintColored(ConsoleColor.White, "-");
            FormatCodeColor(consolePrinter, terminalCode.Code2, overridingColor);
            consolePrinter.PrintColored(ConsoleColor.White, "-");
            FormatCodeColor(consolePrinter, terminalCode.Code3, overridingColor);

            consolePrinter.PrintColored(ConsoleColor.White, " | ");

            FormatCodeNumber(consolePrinter, terminalCode.Code1, overridingColor);
            consolePrinter.PrintColored(ConsoleColor.White, "-");
            FormatCodeNumber(consolePrinter, terminalCode.Code2, overridingColor);
            consolePrinter.PrintColored(ConsoleColor.White, "-");
            FormatCodeNumber(consolePrinter, terminalCode.Code3, overridingColor);

            consolePrinter.PrintLine();
        }
Ejemplo n.º 3
0
        public static void PrintTerminalCodes(IConsolePrinter consolePrinter, TerminalCode alarmCode, TerminalCode secretCode, ConsoleColor overridingColor = default)
        {
            consolePrinter.PrintSectionHeader();

            if (alarmCode.IsDefault)
            {
                consolePrinter.PrintColoredLine(ConsoleColor.Cyan, ResSoE.StatusNoTerminalCodeSet);
            }
            else if (alarmCode.Code1.ToUShort() == EmptySaveSlotValue)
            {
                consolePrinter.PrintColoredLine(ConsoleColor.Yellow, Resources.StatusSaveslotIsEmpty);
            }
            else
            {
                consolePrinter.PrintColored(ConsoleColor.White, $"{Resources.AlarmCode}: ");
                if (alarmCode.IsValid)
                {
                    PrintValidCode(consolePrinter, alarmCode, overridingColor);
                }
                else
                {
                    PrintInvalidCode(alarmCode);
                }

                consolePrinter.PrintColored(ConsoleColor.White, $"{Resources.SecretBossRoomCode}: ");
                if (secretCode.IsValid)
                {
                    PrintValidCode(consolePrinter, secretCode, overridingColor);
                }
                else
                {
                    PrintInvalidCode(secretCode);
                }
            }

            consolePrinter.ResetColor();

            void PrintInvalidCode(TerminalCode alarmCode1) =>
            consolePrinter.PrintColoredLine(ConsoleColor.Red,
                                            $"{ResSoE.StatusInvalidTerminalCode} ({alarmCode1.Code1}-{alarmCode1.Code2}-{alarmCode1.Code3})");
        }
Ejemplo n.º 4
0
        private static StorageCommand GetCommand(ConsoleCommandParser consoleCommandParser, IConsolePrinter consolePrinter)
        {
            consolePrinter.PrintСommandWaitingIcon();
            string rowCommand = Console.ReadLine();

            if (string.IsNullOrWhiteSpace(rowCommand))
            {
                throw new ArgumentException("You have not entered a command.");
            }

            return(consoleCommandParser.Parse(rowCommand.ToLower().Trim()));
        }
Ejemplo n.º 5
0
 public RunMe()
 {
     _fileManager    = new FileManager();
     _imageManager   = new ImageManager();
     _consolePrinter = new ConsolePrinter();
 }
Ejemplo n.º 6
0
 public Controller(IConsolePrinter consolePrinter, ILogger <Controller> logger, IMediator mediator)
 {
     _consolePrinter = consolePrinter;
     _logger         = logger;
     _mediator       = mediator;
 }
Ejemplo n.º 7
0
 public FileManager()
 {
     _consolePrinter = new ConsolePrinter();
     _imageManager   = new ImageManager();
 }
 public TfsRepositoryWalker(IConsolePrinter consolePrinter, IConfigInterpreter configInterpreter, ITfsServerPathTranslator tfsServerPathTranslator)
 {
     ConsolePrinter = consolePrinter;
     this.configInterpreter = configInterpreter;
     this.tfsServerPathTranslator = tfsServerPathTranslator;
 }
Ejemplo n.º 9
0
 public StatementPrinter(IConsolePrinter consolePrinter)
 {
     this.consolePrinter = consolePrinter;
 }
 public SramComparerSoE(IConsolePrinter consolePrinter) : base(consolePrinter)
 {
 }
 public FileSystemWalker(IConsolePrinter consolePrinter, IConfigInterpreter configInterpreter, IFileSystemPathTranslator fileSystemPathTranslator)
 {
     this.configInterpreter = configInterpreter;
     this.fileSystemPathTranslator = fileSystemPathTranslator;
     ConsolePrinter = consolePrinter;
 }
 public ContinuousRunningProcessor(IConsolePrinter consolePrinter, ILogger <ContinuousRunningProcessor> logger)
 {
     this.consolePrinter = consolePrinter;
     this.logger         = logger;
 }
Ejemplo n.º 13
0
 public ImageManager()
 {
     _consolePrinter = new ConsolePrinter();
 }
Ejemplo n.º 14
0
 public TfsRepositoryWalker(IConsolePrinter consolePrinter, IConfigInterpreter configInterpreter, ITfsServerPathTranslator tfsServerPathTranslator)
 {
     ConsolePrinter               = consolePrinter;
     this.configInterpreter       = configInterpreter;
     this.tfsServerPathTranslator = tfsServerPathTranslator;
 }
Ejemplo n.º 15
0
 public FileSystemWalker(IConsolePrinter consolePrinter, IConfigInterpreter configInterpreter, IFileSystemPathTranslator fileSystemPathTranslator)
 {
     this.configInterpreter        = configInterpreter;
     this.fileSystemPathTranslator = fileSystemPathTranslator;
     ConsolePrinter = consolePrinter;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Prevents a default instance of the <see cref="MainMenu"/> class from being created.
 /// </summary>
 private MainMenu()
 {
     _consolePrinter     = new ConsolePrinter();
     _jsonReadWriter     = new JsonReadWriter();
     _wishlistDictionary = _jsonReadWriter.LoadWishlistsFromFile() ?? new Dictionary <int, IWishlist>();
 }