private void basicIdeObj_DebugTrace(object sender, TextEventArgs e) { // *** AddBasic: not recommended (users are not interested in seeing this) // append the trace line to the trace output shown on the form if (txtTrace.Text.Length > 30000) txtTrace.Text = ""; if (txtTrace.Text.Length > 0) txtTrace.AppendText("\r\n"); txtTrace.AppendText(e.Text); txtTrace.ScrollToEnd(); // *** }
public override bool TextEntered(TextEventArgs e) { if (Text.Length >= MaxCharacters || "\b\n\u001b\r".Contains(e.Unicode)) { return(false); } if (ignoreNextText) { ignoreNextText = false; return(false); } Text = Text.Insert(_caretIndex, e.Unicode); if (_caretIndex < _text.Length) { _caretIndex++; } SetVisibleText(); return(true); }
internal void OnTextEntered(object sender, TextEventArgs e) { //Console.WriteLine("text entered: {0}", e.Unicode); if (e.Unicode.Length == 1) { if (e.Unicode[0] == 8) { if (input.Length > 0) { input = input.Remove(input.Length - 1); Text = label + ": " + input; } //Console.WriteLine("backspace"); } else { input += e.Unicode; Text = label + ": " + input; } } }
private void HandleTextEntered(object sender, TextEventArgs e) { if (!HasKeyboardFocus) { return; } if (e.Unicode == "\b") { RemoveOneAtCaret(); } else if (e.Unicode == "\r") { LoseFocus(); State = SelectableState.Unselected; } else if (!IsSpecialCharacter(e.Unicode)) { InsertTextAtCaret(e.Unicode); } }
protected override void DataReceived(object sender, TextEventArgs e) { if (Plink) { if (e.Text.StartsWith("If you trust this host, enter \"y\" to add the key to")) { if (MessageBox.Show(this, _fingerprintNotRegistredText.Text, _fingerprintNotRegistredTextCaption.Text, MessageBoxButtons.YesNo) == DialogResult.Yes) { string remoteUrl = Module.GetPathSetting(string.Format(SettingKeyString.RemoteUrl, Remote)); remoteUrl = string.IsNullOrEmpty(remoteUrl) ? Remote : remoteUrl; remoteUrl = GitCommandHelpers.GetPlinkCompatibleUrl(remoteUrl); Module.RunExternalCmdShowConsole("cmd.exe", string.Format("/k \"\"{0}\" {1}\"", AppSettings.Plink, remoteUrl)); restart = true; } KillGitCommand(); } } base.DataReceived(sender, e); }
void OnTextEntered(object sender, TextEventArgs e) { //convert unicode to ascii to check range later string hexValue = (Encoding.ASCII.GetBytes(e.Unicode)[0].ToString("X")); int ascii = (int.Parse(hexValue, NumberStyles.HexNumber)); if (e.Unicode == "\b") { if (KeyString.Length > 0) { KeyString = KeyString.Remove(KeyString.Length - 1, 1); } } else if (e.Unicode == "\r") { KeyString += "\n"; } else if (ascii >= 32 && ascii < 128) { //only add to keystring if actual character KeyString += e.Unicode; } }
public void TextEntered(object sender, TextEventArgs e) { if (_ctx.MenuState == 3) { if ((e.Unicode[0] > 30 && (e.Unicode[0] < 128 || e.Unicode[0] > 159))) { _ctx.NewGame.Name += e.Unicode; } } else if (Keyboard.IsKeyPressed(Keyboard.Key.Escape)) { if (!_ui.SettingsSelected) { _ui.SettingsSelected = true; } else { _ui.SettingsSelected = false; _ctx.GameTime.TimeScale = 60f; } } }
public void GetInput(TextEventArgs e) { if (TakeInput) { if (e.Unicode == "\b") { if (playerInput.Length > 0) { playerInput = playerInput.Remove(playerInput.Length - 1); playerText.DisplayedString = playerText.DisplayedString.Remove(playerText.DisplayedString.Length - 1); Console.WriteLine(playerInput); } return; } else if (playerInput.Length <= 15) { playerInput += e.Unicode; playerText.DisplayedString = playerInput; } } }
public void TextEntered(TextEventArgs e) { if (HasFocus) { switch (e.Unicode[0]) { case '\b': if (TextString.Length > 0) { TextString = TextString.Remove(TextString.Length - 1, 1); } return; default: if (CheckLength(e.Unicode)) { TextString += e.Unicode; } break; } } }
void window_TextEntered(object sender, TextEventArgs e) { bool handled = false; // did we hit enter? if (e.Unicode == "\r") { if (buffer[0] == '/') { //process command, always starts with slash Console.WriteLine("Processing command: {0}", buffer); CommandManager.HandleCommand(buffer.Substring(1, buffer.Length - 1)); buffer = string.Empty; // clean the buffer handled = true; } } //ctrl + i, tab if (e.Unicode == "\t") { Console.WriteLine("CTRL I PRESSED"); handled = true; } //backspace if (e.Unicode == "\b") { buffer = buffer.Substring(0, buffer.Length - 1); handled = true; } if (!handled) { buffer += e.Unicode; } }
static void OnTextEnter(object sender, TextEventArgs e) { if (textInputTime > textInputTimer) { return; } numberInput = -1; int num; bool isNumber = int.TryParse(e.Unicode, out num); if (isNumber) { numberInput = num; } if (e.Unicode == "\b" || e.Unicode == "\n") { return; } text = e.Unicode; }
private void DataReceivedCore(object sender, TextEventArgs e) { if (e.Text.Contains("%") || e.Text.Contains("remote: Counting objects")) { SetProgress(e.Text); } else { const string ansiSuffix = "\u001B[K"; string line = e.Text.Replace(ansiSuffix, ""); if (ConsoleOutput.IsDisplayingFullProcessOutput) { OutputLog.AppendLine(line); // To the log only, display control displays it by itself } else { AppendOutputLine(line); // Both to log and display control } } DataReceived(sender, e); }
private void DataReceivedCore(object sender, TextEventArgs e) { if (e.Text.Contains("%") || e.Text.Contains("remote: Counting objects")) { ThreadHelper.JoinableTaskFactory.RunAsync(() => SetProgressAsync(e.Text)).FileAndForget(); } else { const string ansiSuffix = "\u001B[K"; string line = e.Text.Replace(ansiSuffix, ""); if (ConsoleOutput.IsDisplayingFullProcessOutput) { OutputLog.Append(line); // To the log only, display control displays it by itself } else { AppendOutput(line); // Both to log and display control } } DataReceived(sender, e); }
private void xmppClient_OnReceiveXml(object sender, TextEventArgs e) { ////if (e.Message.Type == MessageType.GroupChat) ////{ //// string datetime = e.Message.Delay.GetAttribute("stamp"); //// DateTime dt = new DateTime(); //// DateTime.TryParse(datetime, out dt); //// if (DateTime.Now.Date.CompareTo(dt.Date) == 0) //// { //// IncomingMessage(e.Message); //// } ////} //var x = XDocument.Parse(e.Text); //rtfDebug.SelectionStart = rtfDebug.Text.Length; //rtfDebug.SelectionLength = 0; //rtfDebug.SelectionColor = Color.Red; //rtfDebug.AppendText("RECV: "); //rtfDebug.SelectionColor = Color.Black; //rtfDebug.AppendText(e.Text); //rtfDebug.AppendText("\r\n"); //ScrollRtfToEnd(rtfDebug); }
private void HandleText(object sender, TextEventArgs e) { // Convert to the required encoding (e.g. CEA-608) foreach (var bytes in converter.Convert(e.Text, e.Encoding)) { // Word counter and text logger if (archive != null) { try { archive.Send(Encoding.Convert(e.Encoding, Encoding.UTF8, bytes)); } catch (Exception ex) { systemLog.Error($"{LOG_PREFIX} Error while trying to send captions to archive"); systemLog.Debug(ex.Message); systemLog.Debug(ex.StackTrace); } } // Provide to Caption Encoder if (provider != null) { systemLog.DebugFormat("{0} Sending transcription to provider: {1}", LOG_PREFIX, e.Encoding.GetString(bytes)); try { provider.Send(bytes); } catch (Exception ex) { systemLog.Error(LOG_PREFIX + " Error while trying to send captions to provider", ex); } } } }
public static void TextEvent(object o, EventArgs e) { Console.WriteLine("Text event"); TextEventArgs textEvent = e as TextEventArgs; Message msg = null; if (textEvent != null) { msg = textEvent.msg; } else { Console.WriteLine("Shit broke."); return; } switch (Utilities.isCommand(msg.text)) { case "captcha": { Captcha cap = new Captcha(224, 100, 12, 8); StreamContent sc = new StreamContent(cap.GenerateImage()); InlineKeyboardMarkup keyboard = new InlineKeyboardMarkup(); keyboard.SetRowCount(1); keyboard.addButton(new InlineKeyboardButton() { text = "Reload Image (2 Reloads)", callback_data = "dreadbot tuneables" }, 0); Methods.sendPhotoFile(msg.chat.id, sc, "captcha", cap.GetCaptchaCode(), keyboard: keyboard); break; } default: return; } }
private void xmppClient_OnSendXml(object sender, TextEventArgs e) { //rtfDebug.SelectionStart = rtfDebug.Text.Length; //rtfDebug.SelectionLength = 0; //rtfDebug.SelectionColor = Color.Blue; //rtfDebug.AppendText("SEND: "); //rtfDebug.SelectionColor = Color.Black; //rtfDebug.AppendText(e.Text); //rtfDebug.AppendText("\r\n"); //ScrollRtfToEnd(rtfDebug); }
protected virtual void DataReceived(object sender, TextEventArgs e) { }
private void window_TextEntered(object sender, TextEventArgs e) { Canvas.TextEntered(e.Unicode); }
private void xmppClient_OnSendXml(object sender, TextEventArgs e) { rtfDebug.SelectionStart = rtfDebug.Text.Length; rtfDebug.SelectionLength = 0; rtfDebug.SelectionColor = Color.Blue; rtfDebug.AppendText("SEND: "); rtfDebug.SelectionColor = Color.Black; rtfDebug.AppendText(e.Text); rtfDebug.AppendText("\r\n"); }
public override void OnTextEntered(object sender, TextEventArgs e) { throw new NotImplementedException(); }
private void VisualComposition_Error(object?sender, TextEventArgs e) { _tracer.TraceError(e.Text); }
private void TextEntered(object sender, TextEventArgs e) { _stateManager?.TextEntered(e); }
private void Client_OnSendXml(object sender, TextEventArgs e) { System.Diagnostics.Debug.WriteLine(e.Text); }
private void returnJson(TextEventArgs e) { EventHandler<TextEventArgs> eh = goNextEvent; if (eh != null) eh(this, e); }
private void ErrorEvent(EventHandler<TextEventArgs> evnt, TextEventArgs e) { var handler = evnt; if (handler != null) { handler(this, e); } }
private void basicIdeForm_DebugTrace(object sender, TextEventArgs e) { if (basicTraceForm != null) basicTraceForm.AppendLine(e.Text); }
private void ResourceManager_SolutionFolderChanged(object?sender, TextEventArgs e) { Watch(e.Text); }
public void OnTextInput(object sender, TextEventArgs textEventArgs) { MessageBus.Instance.PostEvent(MessageType.TextInput, sender, textEventArgs); }
private void basicthreadcollection_DebugTrace(object sender, TextEventArgs e) { // *** Threads: optional // This method executes in the IBasicThread's thread // add trace line to the debug output tracedata_.Add(e.Text); // *** }
public void TextEntered(TextEventArgs e) { UserInterfaceManager.TextEntered(e); }
public void TextEntered(TextEventArgs e) { UserInterfaceManager.TextEntered(e); //KeyDown returns true if the click is handled by the ui component. }
private void basicNoUIObj_DebugTrace(object sender, TextEventArgs e) { // *** AddBasic: not recommended (users are not interested in seeing this) // append the trace line to the trace output shown on the form if (txtTrace.TextLength > 30000) txtTrace.Text = ""; txtTrace.SelectionStart = txtTrace.TextLength+1; if (txtTrace.TextLength > 0) txtTrace.SelectedText = "\r\n"; txtTrace.SelectedText = e.Text; // *** }
public void RaiseEnglishLineInput(object sender, TextEventArgs args) { OnEnglishLineInput.Raise(sender, args); }
public void TextEntered(TextEventArgs textEvent) { _userInterfaceManager.TextEntered(textEvent); }
private void xmppClient_OnReceiveXml(object sender, TextEventArgs e) { rtfDebug.SelectionStart = rtfDebug.Text.Length; rtfDebug.SelectionLength = 0; rtfDebug.SelectionColor = Color.Red; rtfDebug.AppendText("RECV: "); rtfDebug.SelectionColor = Color.Black; rtfDebug.AppendText(e.Text); rtfDebug.AppendText("\r\n"); }
public void TextEntered(TextEventArgs textEvent) { }
private void messageControl_OnButtonClick(object sender, TextEventArgs e) { RemoveMessageControl(); }
public virtual bool TextEntered(TextEventArgs e) { return(false); }
void textEditor_TextArea_TextCopied(object sender, TextEventArgs e) { ICSharpCode.SharpDevelop.Gui.TextEditorSideBar.Instance.PutInClipboardRing(e.Text); }
private void OnTextEntered(object sender, TextEventArgs e) { currentState.HandleTextEntered(e); }
protected virtual void OnUpdateText(TextEventArgs e) { EventHandler<TextEventArgs> ev = UpdateText; if (ev != null) ev(this, e); // abonnierte Ereignismethode(n) aufrufen }