Exemplo n.º 1
0
 private async Task UpdateText(string text)
 {
     Text = text;
     TextChanged?.Invoke(this, Text);
 }
Exemplo n.º 2
0
 public void ClearInput()
 {
     textbox_input.Text = "";
     TextChanged?.Invoke(this, new TextUpdatedEventArgs(textbox_input.Text));
 }
Exemplo n.º 3
0
 protected virtual void OnTextChanged(string oldValue, string newValue)
 {
     TextChanged?.Invoke(this, new TextChangedEventArgs(oldValue, newValue));
 }
Exemplo n.º 4
0
 private void RichEditBox_TextChanged(object sender, RoutedEventArgs e)
 {
     UpdateVisibleTokenList();
     TextChanged?.Invoke(this, e);
 }
Exemplo n.º 5
0
 protected void HandleTextChange(UIChangeEventArgs e)
 {
     Text = e?.Value?.ToString();
     TextChanged?.Invoke(Text);
 }
Exemplo n.º 6
0
 public static void FireTextChanged(object graphic)
 {
     TextChanged?.Invoke(graphic);
 }
Exemplo n.º 7
0
#pragma warning restore 067
        public void FireEvent()
        {
            TextChanged?.Invoke(this, new TextChangedEventArgs(null, null));
        }
Exemplo n.º 8
0
 private void OnTextChanged()
 {
     TextChanged?.Invoke(this, new EventArgs());
 }
Exemplo n.º 9
0
 /// <summary>
 /// Called when the <see cref="TextChanged"/> event is raised.
 /// </summary>
 protected virtual void OnTextChanged(TextBlockBase sender) => TextChanged?.Invoke(sender);
Exemplo n.º 10
0
 private void DecimalBox_OnTextChanged(object sender, TextChangedEventArgs e)
 {
     TextChanged?.Invoke(sender, e);
 }
Exemplo n.º 11
0
 /// <inheritdoc/>
 protected override Task OnInternalValueChanged(string value)
 {
     return(TextChanged.InvokeAsync(value));
 }
 private void OnTextChanged(string line, ConsoleKey key)
 {
     TextChanged?.Invoke(this, new ConsoleTextChangedEventArgs(line, key));
 }
Exemplo n.º 13
0
 private void OnTextEntered(string text)
 {
     TextChanged?.Invoke(text);
 }
 private void TextBox_LostFocus(object sender, RoutedEventArgs e)
 {
     TextChanged?.Invoke(this, new EditableTextBlockTextChangedEventArgs((sender as TextBox).Text));
     textBox.Visibility   = Visibility.Collapsed;
     textBlock.Visibility = Visibility.Visible;
 }
Exemplo n.º 15
0
 protected virtual void OnTextChanged()
 {
     TextChanged?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 16
0
 public void OnTextChanged()
 {
     TextChanged?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 17
0
 private void TextBox_TextChanged(object sender, EventArgs e)
 {
     TextChanged?.Invoke(sender, e);
 }
Exemplo n.º 18
0
 private void txtIpAddress_TextChanged(object sender, EventArgs e)
 {
     TextChanged?.Invoke(this);
 }
Exemplo n.º 19
0
 public void OnTextboxChanged(int Id, string Text)
 {
     TextChanged?.Invoke(Id, Text);
     DataChanged?.Invoke();
 }
Exemplo n.º 20
0
 protected void HandleText(string text)
 {
     Text = text;
     TextChanged?.Invoke(Text);
 }
 internal void RaiseTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
 {
     TextChanged?.Invoke(sender, args);
 }
Exemplo n.º 22
0
 /// <summary>
 /// Called when the <see cref="TextChanged"/> event is raised.
 /// </summary>
 protected virtual void OnTextChanged(TextBoxBase sender, EventArgs e) => TextChanged?.Invoke(sender, e);
Exemplo n.º 23
0
 /// <summary>
 /// An System.EventArgs that contains the event data.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void T_TextChanged(object sender, EventArgs e)
 {
     Text = T.Text;
     TextChanged?.Invoke(this);
     Invalidate();
 }
Exemplo n.º 24
0
 private void txtEditor_TextChanged(object sender, EventArgs e)
 {
     TextChanged?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 25
0
 protected virtual void OnTextChanged(EventArgs e)
 {
     TextChanged?.Invoke(this, e);
 }
Exemplo n.º 26
0
 void OnEntryChanged(object sender, EventArgs e)
 {
     TextChanged?.Invoke(this, _entryWrapper.Entry.Text);
 }
Exemplo n.º 27
0
 private void EditTextChanged(object s, EventArgs e)
 {
     TextChanged?.Invoke(this, e);
 }
Exemplo n.º 28
0
        public FileViewer()
        {
            TreatAllFilesAsText  = false;
            ShowEntireFile       = false;
            NumberOfVisibleLines = AppSettings.NumberOfContextLines;
            InitializeComponent();
            InitializeComplete();

            UICommandsSourceSet += OnUICommandsSourceSet;

            _internalFileViewer             = new FileViewerInternal(() => Module);
            _internalFileViewer.MouseEnter += (_, e) => OnMouseEnter(e);
            _internalFileViewer.MouseLeave += (_, e) => OnMouseLeave(e);
            _internalFileViewer.MouseMove  += (_, e) => OnMouseMove(e);
            _internalFileViewer.KeyUp      += (_, e) => OnKeyUp(e);

            var internalFileViewerControl = (Control)_internalFileViewer;

            internalFileViewerControl.Dock = DockStyle.Fill;
            Controls.Add(internalFileViewerControl);

            _async = new AsyncLoader();
            _async.LoadingError +=
                (_, e) =>
            {
                if (!IsDisposed)
                {
                    ResetForText(null);
                    _internalFileViewer.SetText("Unsupported file: \n\n" + e.Exception.ToString(), openWithDifftool: null /* not applicable */);
                    TextLoaded?.Invoke(this, null);
                }
            };

            IgnoreWhitespaceChanges   = AppSettings.IgnoreWhitespaceChanges;
            ignoreWhiteSpaces.Checked = IgnoreWhitespaceChanges;
            ignoreWhiteSpaces.Image   = Images.WhitespaceIgnore;
            ignoreWhitespaceChangesToolStripMenuItem.Checked = IgnoreWhitespaceChanges;
            ignoreWhitespaceChangesToolStripMenuItem.Image   = ignoreWhiteSpaces.Image;

            ignoreAllWhitespaces.Checked = AppSettings.IgnoreAllWhitespaceChanges;
            ignoreAllWhitespaces.Image   = Images.WhitespaceIgnoreAll;
            ignoreAllWhitespaceChangesToolStripMenuItem.Checked = ignoreAllWhitespaces.Checked;
            ignoreAllWhitespaceChangesToolStripMenuItem.Image   = ignoreAllWhitespaces.Image;

            ShowEntireFile = AppSettings.ShowEntireFile;
            showEntireFileButton.Checked            = ShowEntireFile;
            showEntireFileToolStripMenuItem.Checked = ShowEntireFile;

            showNonPrintChars.Checked = AppSettings.ShowNonPrintingChars;
            showNonprintableCharactersToolStripMenuItem.Checked = AppSettings.ShowNonPrintingChars;
            ToggleNonPrintingChars(AppSettings.ShowNonPrintingChars);

            IsReadOnly = true;
            var encodingList        = AppSettings.AvailableEncodings.Values.Select(e => e.EncodingName).ToList();
            var defaultEncodingName = Encoding.Default.EncodingName;

            for (int i = 0; i < encodingList.Count; i++)
            {
                if (string.Equals(encodingList[i], defaultEncodingName, StringComparison.OrdinalIgnoreCase))
                {
                    encodingList[i] = "Default (" + Encoding.Default.HeaderName + ")";
                    break;
                }
            }

            encodingToolStripComboBox.Items.AddRange(encodingList.ToArray <object>());

            _internalFileViewer.MouseMove += (_, e) =>
            {
                if (_currentViewIsPatch && !fileviewerToolbar.Visible)
                {
                    fileviewerToolbar.Visible  = true;
                    fileviewerToolbar.Location = new Point(Width - fileviewerToolbar.Width - 40, 0);
                    fileviewerToolbar.BringToFront();
                }
            };
            _internalFileViewer.MouseLeave += (_, e) =>
            {
                if (GetChildAtPoint(PointToClient(MousePosition)) != fileviewerToolbar &&
                    fileviewerToolbar != null)
                {
                    fileviewerToolbar.Visible = false;
                }
            };
            _internalFileViewer.TextChanged += (sender, e) =>
            {
                if (_patchHighlighting)
                {
                    _internalFileViewer.AddPatchHighlighting();
                }

                TextChanged?.Invoke(sender, e);
            };
            _internalFileViewer.ScrollPosChanged    += (sender, e) => ScrollPosChanged?.Invoke(sender, e);
            _internalFileViewer.SelectedLineChanged += (sender, e) => SelectedLineChanged?.Invoke(sender, e);
            _internalFileViewer.DoubleClick         += (_, args) => RequestDiffView?.Invoke(this, EventArgs.Empty);

            HotkeysEnabled = true;

            if (!IsDesignModeActive && ContextMenuStrip == null)
            {
                ContextMenuStrip = contextMenu;
            }

            contextMenu.Opening += (sender, e) =>
            {
                copyToolStripMenuItem.Enabled = _internalFileViewer.GetSelectionLength() > 0;
                ContextMenuOpening?.Invoke(sender, e);
            };

            _fullPathResolver = new FullPathResolver(() => Module.WorkingDir);
        }
Exemplo n.º 29
0
 protected virtual void OnTextChanged(EventArgs e) => TextChanged?.Invoke(this, new TextChangedEventArgs(Text));
        public void WriteLine(string message)
        {
            _text.AppendLine(message);

            TextChanged?.Invoke(this, EventArgs.Empty);
        }