예제 #1
0
        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();
            // ***
        }
예제 #2
0
        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);
        }
예제 #3
0
 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;
         }
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
        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;
            }
        }
예제 #7
0
 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;
         }
     }
 }
예제 #8
0
        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;
                }
            }
        }
예제 #9
0
        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;
                }
            }
        }
예제 #10
0
        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;
            }
        }
예제 #11
0
        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;
        }
예제 #12
0
        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);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        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);
                    }
                }
            }
        }
예제 #16
0
        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;
            }
        }
예제 #17
0
 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);
 }
예제 #18
0
 protected virtual void DataReceived(object sender, TextEventArgs e)
 {
 }
예제 #19
0
 private void window_TextEntered(object sender, TextEventArgs e)
 {
     Canvas.TextEntered(e.Unicode);
 }
예제 #20
0
파일: FrmMain.cs 프로젝트: uri247/lib
 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");
 }
예제 #21
0
 public override void OnTextEntered(object sender, TextEventArgs e)
 {
     throw new NotImplementedException();
 }
예제 #22
0
 private void VisualComposition_Error(object?sender, TextEventArgs e)
 {
     _tracer.TraceError(e.Text);
 }
예제 #23
0
 private void TextEntered(object sender, TextEventArgs e)
 {
     _stateManager?.TextEntered(e);
 }
예제 #24
0
파일: Commands.cs 프로젝트: charla-n/FTR
 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);
 }
예제 #26
0
 private void ErrorEvent(EventHandler<TextEventArgs> evnt, TextEventArgs e)
 {
     var handler = evnt;
     if (handler != null)
     {
         handler(this, e);
     }
 }
예제 #27
0
        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);
        }
예제 #28
0
 private void basicIdeForm_DebugTrace(object sender, TextEventArgs e)
 {
     if (basicTraceForm != null)
         basicTraceForm.AppendLine(e.Text);
 }
예제 #29
0
 private void ResourceManager_SolutionFolderChanged(object?sender, TextEventArgs e)
 {
     Watch(e.Text);
 }
예제 #30
0
 public void OnTextInput(object sender, TextEventArgs textEventArgs)
 {
     MessageBus.Instance.PostEvent(MessageType.TextInput, sender, textEventArgs);
 }
예제 #31
0
 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);
     // ***
 }
예제 #32
0
 public void TextEntered(TextEventArgs e)
 {
     UserInterfaceManager.TextEntered(e);
 }
예제 #33
0
 public void TextEntered(TextEventArgs e)
 {
     UserInterfaceManager.TextEntered(e); //KeyDown returns true if the click is handled by the ui component.
 }
예제 #34
0
        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;
            // ***
        }
예제 #35
0
 public void RaiseEnglishLineInput(object sender, TextEventArgs args)
 {
     OnEnglishLineInput.Raise(sender, args);
 }
예제 #36
0
 public void TextEntered(TextEventArgs textEvent)
 {
     _userInterfaceManager.TextEntered(textEvent);
 }
예제 #37
0
파일: FrmMain.cs 프로젝트: uri247/lib
 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");
 }
예제 #38
0
 public void TextEntered(TextEventArgs textEvent)
 {
 }
예제 #39
0
 private void messageControl_OnButtonClick(object sender, TextEventArgs e)
 {
     RemoveMessageControl();
 }
예제 #40
0
 public virtual bool TextEntered(TextEventArgs e)
 {
     return(false);
 }
예제 #41
0
 void textEditor_TextArea_TextCopied(object sender, TextEventArgs e)
 {
     ICSharpCode.SharpDevelop.Gui.TextEditorSideBar.Instance.PutInClipboardRing(e.Text);
 }
예제 #42
0
 private void OnTextEntered(object sender, TextEventArgs e)
 {
     currentState.HandleTextEntered(e);
 }
예제 #43
0
파일: Netzwerk.cs 프로젝트: kuhjunge/maedn
 protected virtual void OnUpdateText(TextEventArgs e)
 {
     EventHandler<TextEventArgs> ev = UpdateText;
     if (ev != null)
         ev(this, e); // abonnierte Ereignismethode(n) aufrufen
 }