private void CalculateKeypadCode(ICollection <string> codes, IKeypad keypad) { var code = _bathroomCode.Aggregate(string.Empty, (current, s) => CalculateInstructionsLine(keypad, current, s)); codes.Add(code); }
public Withdrawal(int userAccount, IScreen atmScreen, IBankDatabase atmBankDatabase, IKeypad atmKeypad, ICashDispenser atmCashDispenser) : base(userAccount, atmBankDatabase, atmScreen) { _keypad = atmKeypad; _cashDispenser = atmCashDispenser; }
public Deposit(int userAccountNumber, IScreen atmScreen, IBankDatabase atmBankDatabase, IKeypad atmKeypad, IDepositSlot atmDepositSlot) : base(userAccountNumber, atmBankDatabase, atmScreen) { _keypad = atmKeypad; _depositSlot = atmDepositSlot; }
public bool Initialize() { lock (action_lock) { if (!IsInitialized()) { try { if (!Chroma.SdkAvailable) { throw new Exception("No Chroma SDK available"); } Chroma.Instance.Initialize(); Global.logger.LogLine("Razer device, Initialized", Logging_Level.Info); keyboard = Chroma.Instance.Keyboard; mouse = Chroma.Instance.Mouse; headset = Chroma.Instance.Headset; mousepad = Chroma.Instance.Mousepad; keypad = Chroma.Instance.Keypad; if (keyboard == null && mouse == null && headset == null && mousepad == null && keypad == null ) { throw new Exception("No devices connected"); } else { if (Global.Configuration.razer_first_time) { RazerInstallInstructions instructions = new RazerInstallInstructions(); instructions.ShowDialog(); Global.Configuration.razer_first_time = false; Settings.ConfigManager.Save(Global.Configuration); } isInitialized = true; return(true); } } catch (Exception ex) { Global.logger.LogLine("Razer device, Exception! Message:" + ex, Logging_Level.Error); } isInitialized = false; return(false); } return(isInitialized); } }
private static string CalculateInstructionsLine(IKeypad keypad, string code, string instruction) { foreach (var step in instruction) { keypad.Walk(step); } code = code + keypad.CurrentPosition.Name; return(code); }
/// <summary> /// no-argument ATM constructor initializes instance variables /// </summary> public ATM(ICashDispenser cashDispenser, IBankDatabase bankDatabase, IDepositSlot depositSlot, IKeypad keypad, IScreen screen, IMenu menu) { _userAuthenticated = false; _currentAccountNumber = 0; _depositSlot = depositSlot; _keypad = keypad; _screen = screen; _menu = menu; _cashDispenser = cashDispenser; _bankDatabase = bankDatabase; }
public MenuPrincipal() { this.keypad = new Keypad(); this.keypad.SoundsChange += Keypad_SoundsChange; this.keypad.TagsChange += Keypad_TagsChange; this.keypad.PlayListChange += Keypad_PlayListChange; InitializeComponent(); this.playListLeft = this.panelPlayList.Left; this.defaultSize = this.Size; this.minSize = new Size(1122, this.Size.Height); this.comboBoxPlayList.ValueMember = "Name"; this.comboBoxPlayList.DisplayMember = "Name"; //this.checkedListBoxTags.Items.AddRange(this.GetTagList().ToArray()); }
public bool Initialize() { lock (action_lock) { if (!IsInitialized()) { try { if (!Chroma.SdkAvailable) { throw new Exception("No Chroma SDK available"); } Chroma.Instance.Initialize(); Global.logger.Info("Razer device, Initialized"); keyboard = Chroma.Instance.Keyboard; mouse = Chroma.Instance.Mouse; headset = Chroma.Instance.Headset; mousepad = Chroma.Instance.Mousepad; keypad = Chroma.Instance.Keypad; if (keyboard == null && mouse == null && headset == null && mousepad == null && keypad == null ) { throw new Exception("No devices connected"); } else { /*if (Chroma.Instance.Query(Corale.Colore.Razer.Devices.BladeStealth).Connected || Chroma.Instance.Query(Corale.Colore.Razer.Devices.Blade14).Connected) * bladeLayout = true;*/ if (Global.Configuration.razer_first_time) { RazerInstallInstructions instructions = new RazerInstallInstructions(); instructions.ShowDialog(); Global.Configuration.razer_first_time = false; Settings.ConfigManager.Save(Global.Configuration); } isInitialized = true; return(true); } } catch (Exception ex) { Global.logger.Error("Razer device, Exception! Message:" + ex); } isInitialized = false; return(false); } return(isInitialized); } }
public T9MessageTranslator(IKeypad keypad) { _keypad = keypad; }
public Converter(IKeypad keypad) { Keypad = keypad; }
public T9MessageTranslator_TranslateMessageShould() { _keypad = new T9Keypad(); _translator = new T9MessageTranslator(_keypad); }
public FileConverter(IKeypad keypad, string inFile) : base(keypad) { _inFile = inFile; _outFile = Path.ChangeExtension(_inFile, ".out"); }
public ITransaction CreateTransaction(int type, int currentAccountNumber, IBankDatabase atmBankDatabase, IScreen atmScreen, IKeypad atmKeypad, ICashDispenser atmCashDispenser, IDepositSlot atmDepositSlot) { ITransaction temp = null; switch (type) { case 1: temp = new BalanceInquiry(currentAccountNumber, atmScreen, atmBankDatabase); break; case 2: temp = new Withdrawal(currentAccountNumber, atmScreen, atmBankDatabase, atmKeypad, atmCashDispenser); break; case 3: temp = new Deposit(currentAccountNumber, atmScreen, atmBankDatabase, atmKeypad, atmDepositSlot); break; } return(temp); }
public CalculatorInterface(IScreen screen, IKeypad keypad) { this.screen = screen; this.keypad = keypad; }
public KeypadClicker(IKeypad keypad, KeypadButton startButton = KeypadButton.Button5) { _keypad = keypad; CurrentButton = startButton; }