public bool ParseCommand(string Subject, Comands Command, MyConsoleKeyInfo KeyInfo) { if (!this.Controls.ContainsKey(Subject)) { throw new ArgumentOutOfRangeException("Subject"); } ActiveComponent = this.Controls[Subject]; return(ParseCommand(Command, KeyInfo)); }
public virtual bool NewInput(MyConsoleKeyInfo KeyInfo) { switch (KeyInfo.KeyChar) { case (char)SpecialAsciiKeys.Tab: OnTab?.Invoke(this, DateTime.Now); return(true); case '\n': OnAccept?.Invoke(this, DateTime.Now); return(true); } return(false); }
public override bool NewInput(MyConsoleKeyInfo KeyInfo) { if (mAcceptedCharacters.Any(i => i == KeyInfo.KeyChar)) { InsertCharInText(mCursorTop, mCursorLeft, KeyInfo.KeyChar); return(true); } else { switch (KeyInfo.KeyChar) { case (char)SpecialAsciiKeys.Backspace: RemoveCharFormText(1); return(true); case (char)SpecialAsciiKeys.Del: RemoveCharFormText(-1); return(true); case (char)SpecialAsciiKeys.ArrowUp: MoveCursureVertical(1); return(true); case (char)SpecialAsciiKeys.ArrowDown: MoveCursureVertical(-1); return(true); case (char)SpecialAsciiKeys.ArrowRight: MoveCursureHorisontal(1); return(true); case (char)SpecialAsciiKeys.ArrowLeft: MoveCursureHorisontal(-1); return(true); } } return(base.NewInput(KeyInfo)); }
public override bool NewInput(MyConsoleKeyInfo c) { return(base.NewInput(c)); }
public bool ParseCommand(Component Subject, Comands Command, MyConsoleKeyInfo KeyInfo) { ActiveComponent = Subject; return(ParseCommand(Command, KeyInfo)); }
public bool ParseCommand(Comands Command, MyConsoleKeyInfo KeyInfo) { switch (InputMode) { case InputMode.ControlOnly: try { Comand[Command](CommandControls.InvokedBaseCommand[Command]); return(true); } catch (Exception ex) { EnqueMessage(ex); return(false); } case InputMode.ControlFirst: try { Comand[Command](CommandControls.InvokedBaseCommand[Command]); return(true); } catch { if (UIComponents.ParseCommand(KeyInfo)) { if (this.Name == Active.Peek().Name) { ScreenChange(); } return(true); } return(false); } case InputMode.InputOnly: if (UIComponents.ParseCommand(KeyInfo)) { if (this.Name == Active.Peek().Name) { ScreenChange(); } return(true); } return(false); case InputMode.InputFirst: if (!UIComponents.ParseCommand(KeyInfo)) { try { Comand[Command](CommandControls.InvokedBaseCommand[Command]); return(true); } catch (Exception ex) { EnqueMessage(ex); return(false); } } else if (this.Name == Active.Peek().Name) { ScreenChange(); } return(true); } return(false); }
public bool ParseCommand(MyConsoleKeyInfo KeyInfo) { return((bool)CurrentActive?.NewInput(KeyInfo)); }