示例#1
0
 // Token: 0x06004219 RID: 16921 RVA: 0x0012E5FA File Offset: 0x0012C7FA
 private void OnTextContainerChanged(object sender, TextContainerChangedEventArgs args)
 {
     if (args.HasContentAddedOrRemoved)
     {
         this.UpdateAccessKey();
     }
 }
示例#2
0
 // ------------------------------------------------------------------
 // Handler for TextContainer.Changed notification.
 // ------------------------------------------------------------------
 private void OnTextContainerChanged(object sender, TextContainerChangedEventArgs args)
 {
     // Skip changes that only affect properties.
     if (args.HasContentAddedOrRemoved)
     {
         UpdateAccessKey();
     }
 }
示例#3
0
 // Token: 0x06005354 RID: 21332 RVA: 0x001728B3 File Offset: 0x00170AB3
 private void OnTextContainerChanged(object sender, TextContainerChangedEventArgs e)
 {
     if (!e.HasContentAddedOrRemoved)
     {
         return;
     }
     base.RaiseEvent(new RoutedEventArgs(PasswordBox.PasswordChangedEvent));
 }
示例#4
0
        /// <summary>
        /// Handler for text array change notifications.
        /// </summary>
        /// <param name="sender">
        /// sender
        /// </param>
        /// <param name="e">
        /// event args
        /// </param>
        private void OnTextContainerChanged(object sender, TextContainerChangedEventArgs e)
        {
            // If only properties on the text changed, don't fire a content change event.
            // This can happen even in a plain text TextBox if we switch logical trees.
            if (!e.HasContentAddedOrRemoved)
            {
                return;
            }

            RaiseEvent(new RoutedEventArgs(PasswordChangedEvent));
        }
示例#5
0
 // Token: 0x06005369 RID: 21353 RVA: 0x00172EA4 File Offset: 0x001710A4
 internal void EndChange(bool skipEvents)
 {
     Invariant.Assert(this._changeBlockLevel > 0, "Unmatched EndChange call!");
     this._changeBlockLevel--;
     if (this._changeBlockLevel == 0 && this._changes != null)
     {
         TextContainerChangedEventArgs changes = this._changes;
         this._changes = null;
         if (this.Changed != null && !skipEvents)
         {
             this.Changed(this, changes);
         }
     }
 }
        //------------------------------------------------------
        //
        //  Private Methods
        //
        //------------------------------------------------------

        #region Private Methods

        private void AddChange(ITextPointer startPosition, int symbolCount, PrecursorTextChangeType precursorTextChange)
        {
            Invariant.Assert(_changeBlockLevel > 0, "All public APIs must call BeginChange!");
            Invariant.Assert(!_isReadOnly, "Illegal to modify PasswordTextContainer inside Change event scope!");

            // Contact any listeners.
            if (this.Changing != null)
            {
                Changing(this, EventArgs.Empty);
            }

            // Fire the ChangingEvent now if we haven't already.
            if (_changes == null)
            {
                _changes = new TextContainerChangedEventArgs();
            }

            _changes.AddChange(precursorTextChange, startPosition.Offset, symbolCount, false /* collectTextChanges */);

            if (this.Change != null)
            {
                Invariant.Assert(precursorTextChange == PrecursorTextChangeType.ContentAdded || precursorTextChange == PrecursorTextChangeType.ContentRemoved);
                TextChangeType textChange = (precursorTextChange == PrecursorTextChangeType.ContentAdded) ?
                                            TextChangeType.ContentAdded : TextChangeType.ContentRemoved;

                _isReadOnly = true;
                try
                {
                    Change(this, new TextContainerChangeEventArgs(startPosition, symbolCount, symbolCount, textChange));
                }
                finally
                {
                    _isReadOnly = false;
                }
            }
        }
示例#7
0
        //-------------------------------------------------------------------
        //
        //  Private Methods
        //
        //-------------------------------------------------------------------

        #region Private Methods

        /// <summary>
        /// Notify about content changes.
        /// </summary>
        private void OnTextContainerChanged(object sender, TextContainerChangedEventArgs e)
        {
            _textPeer.RaiseAutomationEvent(AutomationEvents.TextPatternOnTextChanged);
        }