示例#1
0
        private void rtb_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (!IsLoaded)
            {
                return;
            }
            if (ChangeEventHelper.IsInChange)
            {
                return;
            }

            UndoRedoHelper.HandleTextChanged(e);

            LeftHighlightedParenthesis  = Segment.Empty;
            RightHighlightedParenthesis = Segment.Empty;
            LeftHighlightedBracket      = Segment.Empty;
            RightHighlightedBracket     = Segment.Empty;
            LeftHighlightedCurlyBrace   = Segment.Empty;
            RightHighlightedCurlyBrace  = Segment.Empty;

            RecolouringLoop.SendWaitAndExecute( );
            HighlightingLoop.SendWaitAndExecute( );

            TextChanged?.Invoke(this, null);
        }
示例#2
0
        private void findTextChanged(object sender, EventArgs e)
        {
            _currentText = _searchBar.Input.Text;

            UpdateSuggestInput();
            TextChanged?.Invoke();
        }
示例#3
0
 protected void OnTextChanged()
 {
     if (TextChanged != null)
     {
         TextChanged.Invoke(this, EventArgs.Empty);
     }
 }
示例#4
0
 private void _editor_TextChanged(object sender, EventArgs e)
 {
     if (TextChanged != null)
     {
         TextChanged.Invoke(this, e);
     }
 }
示例#5
0
        private void TextDocument_TextChanged(object sender, EventArgs e)
        {
            UnsavedFile unsavedFile = null;

            lock (UnsavedFiles)
            {
                unsavedFile = UnsavedFiles.BinarySearch(ProjectFile.Location);
            }

            if (unsavedFile == null)
            {
                lock (UnsavedFiles)
                {
                    UnsavedFiles.InsertSorted(new UnsavedFile(ProjectFile.Location, TextDocument.Text));
                }
            }
            else
            {
                unsavedFile.Contents = TextDocument.Text;
            }

            IsDirty = true;

            TextChanged?.Invoke(this, new EventArgs());
        }
        public MaterialEntry()
        {
            InitializeComponent();
            EntryField.BindingContext    = this;
            BottomBorder.BackgroundColor = DefaultColor;
            EntryField.TextChanged      += (s, a) =>
            {
                TextChanged?.Invoke(s, a);
            };

            EntryField.Focused += async(s, a) =>
            {
                EntryFocused?.Invoke(this, a);
                await CalculateLayoutFocused();
            };
            EntryField.Unfocused += async(s, a) =>
            {
                EntryUnfocused?.Invoke(this, a);
                await CalculateLayoutUnfocused();
            };
            EntryField.PropertyChanged += async(sender, args) =>
            {
                if (args.PropertyName == nameof(EntryField.Text) && !EntryField.IsFocused && !String.IsNullOrEmpty(EntryField.Text))
                {
                    await CalculateLayoutUnfocused();
                }
            };

            UpdateValidation();
        }
示例#7
0
        private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
        {
            TextChanged?.Invoke(sender, args);

            string t = sender.Text.Trim();

            if (!string.IsNullOrEmpty(TokenDelimiter) && t.Contains(TokenDelimiter))
            {
                bool lastDelimited = t[t.Length - 1] == TokenDelimiter[0];

                string[] tokens          = t.Split(TokenDelimiter);
                int      numberToProcess = lastDelimited ? tokens.Length : tokens.Length - 1;
                for (int position = 0; position < numberToProcess; position++)
                {
                    string token = tokens[position];
                    token = token.Trim();
                    if (token.Length > 0)
                    {
                        _ = AddToken(token);
                    }
                }

                if (lastDelimited)
                {
                    sender.Text = string.Empty;
                }
                else
                {
                    sender.Text = tokens[tokens.Length - 1];
                }
            }
        }
示例#8
0
 private void TextArea_LostFocus(object sender, RoutedEventArgs e)
 {
     if (TextChanged != null)
     {
         TextChanged.Invoke(this, new TextChangedEventArgs(this.textEditor.Text));
     }
 }
示例#9
0
        private void MonitorChanges(Action action)
        {
            var oldScrollBarParameter = curScrollBarParameter;
            var oldText             = textViewText;
            var oldFirstVisibleLine = textViewFirstVisibleLine;

            action();
            if (textViewText != oldText)
            {
                SelectionRange selectionRange = GetSelectionRange();
                selectionDirty = false;

                TextChanged?.Invoke(this, textViewText, textViewFirstVisibleLine, selectionRange);
            }
            else if (textViewFirstVisibleLine != oldFirstVisibleLine)
            {
                FirstVisibleLineChanged?.Invoke(this, textViewFirstVisibleLine);
            }

            if (ScrollBarParameterChanged(oldScrollBarParameter, curScrollBarParameter))
            {
                VScrollBarParameterChanged?.Invoke(this, curScrollBarParameter);
                IsAtEndOfFile = curScrollBarParameter.EndValue == 1;
            }
        }
示例#10
0
        private void InputTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            TextChanged.Invoke(sender, e);
            var textBox = ((TextBox)sender);

            textBox.CaretIndex = textBox.Text.Length;
        }
示例#11
0
 /// <summary>
 /// Raises the FancyControls.Counter.ValueChanged event.
 /// </summary>
 /// <param name="e">
 /// A FancyControls.ValueEventArgs that contains the event data.
 /// </param>
 protected void OnTextChanged(ValueEventArgs <string> e)
 {
     textLbl.Text = text;
     textLbl.Font = new Font(textLbl.Font.FontFamily, textFontSize);
     Algorithms.FitTextByWidth(textLbl);
     TextChanged?.Invoke(this, e);
 }
        /// <summary>
        /// Handles resetting buttons when text boxes are changed.
        /// </summary>
        /// <param name="sender">Object that fired the event.</param>
        /// <param name="e">Event arguments.</param>
        private void commonTextChangedHandler(object sender, TextChangedEventArgs e)
        {
            if (Regex.IsMatch(this.secondBallTextBox.Text, @"[\d]{1}"))
            {
                // A digit was entered in the second text box, indicating that they got an open frame.
                // Lock the third text box.
                this.thirdBallTextBox.IsEnabled = false;
            }

            if (!this.thirdBallTextBox.IsEnabled && !(Regex.IsMatch(this.firstBallTextBox.Text, @"[\d]{1}") && Regex.IsMatch(this.secondBallTextBox.Text, @"[\d]{1}")))
            {
                // The Strike button had been clicked and the second text box locked but the first text box is now clear.
                // Re-enable the second text box.
                this.thirdBallTextBox.IsEnabled = true;
            }

            if (this.firstBallTextBox.Text == "" && this.secondBallTextBox.Text == "/")
            {
                // The user entered a number, then clicked spare, and now tried to remove the first number without removing the spare.
                // Remove the spare.
                this.secondBallTextBox.Text = "";
            }

            if (this.secondBallTextBox.Text == "" && this.thirdBallTextBox.Text == "/")
            {
                // The user entered a number, then clicked spare, and now tried to remove the first number without removing the spare.
                // Remove the spare.
                this.thirdBallTextBox.Text = "";
            }

            TextChanged?.Invoke(sender, e);
        }
示例#13
0
 public FieldBox()
 {
     InitializeComponent();
     fieldBox.TextChanged      += (s, e) => TextChanged?.Invoke(s, e);
     fieldBox.PreviewTextInput += (s, e) => PreviewInput?.Invoke(s, e);
     fieldBox.LostFocus        += (s, e) => InputLostFocus?.Invoke(s, e);
 }
        protected override void OnApplyTemplate()
        {
            // TextChanged Event can trigger calls to characterCountPresenter ==> needs to be loaded first
            characterCountPresenter     = GetTemplateChild <ContentPresenter>("CharacterCountPresenter");
            textBoxControl              = GetTemplateChild <TextBox>("TextTextBox");
            textBoxControl.TextChanged += (s, e) => TextChanged?.Invoke(s, e);
            textBoxControl.KeyDown     += TextBoxControl_KeyDown;
            textBoxControl.GotFocus    += MaterialTextBox_GotFocus;
            textBoxControl.LostFocus   += MaterialTextBox_LostFocus;
            labelPresenter              = GetTemplateChild <ContentPresenter>("LabelPresenter");
            labelPresenter.Loaded      += LabelPresenter_Loaded;
            overlayTextPresenter        = GetTemplateChild <ContentPresenter>("OverlayTextPresenter");
            errorTextPanel              = GetTemplateChild <StackPanel>("ErrorTextPanel");

            this.PointerEntered += MaterialTextBox_PointerEntered;
            this.PointerExited  += MaterialTextBox_PointerExited;

            SetCommonVisualStates(false);
            SetOverlayTextVisualStates(false);
            //SetLabelVisualState called in labelPresenter.Loaded event because the height property of the label is needed before the VisualState is set
            UpdateCharacterCountPresenter();
            TextChanged += MaterialTextBox_TextChanged;

            isTemplatApplied = true;
        }
        private void btnOpenFile_Click(object sender, RoutedEventArgs e)
        {
            Ookii.Dialogs.Wpf.VistaOpenFileDialog ofd = new Ookii.Dialogs.Wpf.VistaOpenFileDialog();
            ofd.AddExtension     = true;
            ofd.CheckFileExists  = ofd.CheckPathExists = true;
            ofd.DefaultExt       = DefaultExt;
            ofd.FileName         = Filename;
            ofd.Filter           = Filter;
            ofd.FilterIndex      = FilterIndex;
            ofd.Multiselect      = MultiSelect;
            ofd.RestoreDirectory = true;
            ofd.Title            = Title;

            bool?Res = ofd.ShowDialog();

            if (Res.HasValue && Res.Value)
            {
                Filename    = ofd.FileName;
                Filenames   = ofd.FileNames;
                Filter      = ofd.Filter;
                FilterIndex = ofd.FilterIndex;

                TextChanged?.Invoke(this, new FileTextboxChangedEventArgs(Filename, Filenames));
            }
        }
示例#16
0
        private void rtb_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (!IsLoaded)
            {
                return;
            }
            if (ChangeEventHelper.IsInChange)
            {
                return;
            }

            RecolouringLoop.SendRewind( );
            LocalUnderliningLoop.SendRewind( );
            ExternalUnderliningLoop.SendRewind( );

            UndoRedoHelper.HandleTextChanged(e);

            //...
            //lock( this )
            //{
            //	LastMatches = null;
            //	LastShowCaptures = false;
            //	LastEol = null;
            //}

            MatchesUpdatedEvent.Reset( );

            TextChanged?.Invoke(this, null);
        }
示例#17
0
 void OnTextChanged(object sender, EventArgs e)
 {
     if (TextChanged != null)
     {
         TextChanged.Invoke(this, e);
     }
 }
示例#18
0
 public override void Write(string value)
 {
     if (TextChanged != null)
     {
         TextChanged.Invoke(this, value);
     }
 }
        /// ------------------------------------------------------------------------------------------------

        /// ------------------------------------------------------------------------------------------------
        #region Private Functions
        /// ------------------------------------------------------------------------------------------------
        ///
        /// ------------------------------------------------------------------------------------------------
        /// Name		InputTapped
        ///
        /// <summary>
        /// To give input value
        /// </summary>
        ///
        /// <remarks>
        /// </remarks>
        /// ------------------------------------------------------------------------------------------------
        ///
        private async void InputTapped(object sender, EventArgs e)
        {
            try
            {
                var objSender = sender as Label;

                if (objSender != null)
                {
                    if (Text != ParagraphViewModel.DEFAULT_VALUE_TEXT)
                    {
                        InputValue = Text;
                    }

                    InputValue = await DependencyService.Get <IInputDialog>().ShowDialog(InputValue);

                    if (!string.IsNullOrWhiteSpace(InputValue))
                    {
                        objSender.Text = _getText = InputValue;
                        TextChanged.Invoke();
                        VisitActionDetailsPage.CurrentInstance.RefreshList();
                    }
                }
            }
            catch (Exception ex)
            {
                LogTracking.LogTrace(ex.ToString());
            }
        }
示例#20
0
 private void rcb_ValueChanged(object sender, RoutedEventArgs e)
 {
     TextChanged?.Invoke(sender, new TextPickerEventArgs()
     {
         Text = (string)tbMain.Text, FontFamily = (string)rcb.Value2
     });
 }
 public void FireTextChanged(string text, AutoSuggestBoxTextChangedEventArgs args)
 {
     suppressTextChangedEvent = true;
     Text = text;
     suppressTextChangedEvent = false;
     TextChanged?.Invoke(this, args);
 }
示例#22
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            if (_showSearchButton != null)
            {
                _showSearchButton.Click -= SearchButton_Click;
            }

            if (_hideSearchButton != null)
            {
                _hideSearchButton.Click -= SearchButton_Click;
            }

            if (TryGetTemplatedChild(PART_ShowSearchButton, out _showSearchButton))
            {
                _showSearchButton.Click += SearchButton_Click;
            }

            if (TryGetTemplatedChild(PART_HideSearchButton, out _hideSearchButton))
            {
                _hideSearchButton.Click += SearchButton_Click;
            }

            _commandsFlyout = GetTemplatedChild <MenuFlyout>(PART_CommandsFlyout);
            _groupContent   = GetTemplatedChild <VisualStateGroup>(GROUP_CommonStates);
            _autoSuggestBox = GetTemplatedChild <AutoSuggestBox>(PART_SearchBox);

            _autoSuggestBox.TextChanged      += (s, e) => TextChanged?.Invoke(s, e);
            _autoSuggestBox.SuggestionChosen += (s, e) => SuggestionChoosen?.Invoke(s, e);
            _autoSuggestBox.QuerySubmitted   += (s, e) => QuerySubmitted?.Invoke(s, e);

            Update();
        }
示例#23
0
        public override void Draw()
        {
            if (this.Style == null)
            {
                this.Style = new UnityEngine.GUIStyle(UnityEngine.GUI.skin.textArea);
            }

            if (_SetRichText.HasValue)
            {
                this.Style.richText = _SetRichText.Value;
                _SetRichText        = null;
            }

            if (this.Visible)
            {
                String newText = UnityEngine.GUILayout.TextArea(Text, Style, Options);

                if (IsEditable && newText != Text)
                {
                    TextChanged?.Invoke(this);
                }

                if (IsEditable)
                {
                    Text = newText;
                }
            }
        }
 private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e)
 {
     TextChanged?.Invoke(this, new Projekt_HKP.GUI.Events.TextChangedEventArgs()
     {
         NewText = Text
     });
 }
示例#25
0
 public void SetText(string text)
 {
     TypedText = string.Empty;
     textInputEventArgs.Clear();
     TypedText = text;
     TextChanged?.Invoke(TypedText);
 }
示例#26
0
 private void TextChangedEvent()
 {
     if (TextChanged != null)
     {
         TextChanged.Invoke();
     }
 }
示例#27
0
 // Called by the native control when users enter text
 internal void NativeControlTextChanged(string text, AutoSuggestionBoxTextChangeReason reason)
 {
     suppressTextChangedEvent = true; //prevent loop of events raising, as setting this property will make it back into the native control
     Text = text;
     suppressTextChangedEvent = false;
     TextChanged?.Invoke(this, new AutoSuggestBoxTextChangedEventArgs(reason));
 }
示例#28
0
        public FileViewerInternal()
        {
            InitializeComponent();
            InitializeComplete();

            _currentViewPositionCache = new CurrentViewPositionCache(this);

            TextEditor.TextChanged += (s, e) => TextChanged?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.VScrollBar.ValueChanged += (s, e) => ScrollPosChanged?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.KeyUp          += (s, e) => KeyUp?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.DoubleClick    += (s, e) => DoubleClick?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseMove      += (s, e) => MouseMove?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseEnter     += (s, e) => MouseEnter?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseLeave     += (s, e) => MouseLeave?.Invoke(s, e);
            TextEditor.ActiveTextAreaControl.TextArea.MouseDown      += (s, e) =>
            {
                SelectedLineChanged?.Invoke(
                    this,
                    new SelectedLineEventArgs(
                        TextEditor.ActiveTextAreaControl.TextArea.TextView.GetLogicalLine(e.Y)));
            };

            HighlightingManager.Manager.DefaultHighlighting.SetColorFor("LineNumbers", new HighlightColor(Color.FromArgb(80, 0, 0, 0), Color.White, false, false));
            TextEditor.ActiveTextAreaControl.TextEditorProperties.EnableFolding = false;

            _lineNumbersControl = new DiffViewerLineNumberControl(TextEditor.ActiveTextAreaControl.TextArea);

            VRulerPosition = AppSettings.DiffVerticalRulerPosition;
        }
示例#29
0
        protected virtual void OnTextChanged(EventArgs e)
        {
            var text = this.Text;

            TextChanged?.Invoke(this, new TextChangedEventArgs {
                Text = text
            });
        }
示例#30
0
        private Task UpdateValue(float value)
        {
            var text = value <= 0 ? "" : $"{Zoom}: {value:#0.##}";

            Text = text;
            TextChanged?.Invoke(this, Text);
            return(Task.CompletedTask);
        }