Beispiel #1
0
        // Callback from TextStore.OnLayoutUpdated.
        // Updates composition display attribute adorner on-screen location.
        internal void OnLayoutUpdated()
        {
            TextServicesDisplayAttributePropertyRanges displayAttributes = _propertyRanges as TextServicesDisplayAttributePropertyRanges;

            if (displayAttributes != null)
            {
                displayAttributes.OnLayoutUpdated();
            }
        }
Beispiel #2
0
        // Token: 0x06003C8E RID: 15502 RVA: 0x00117F00 File Offset: 0x00116100
        internal void OnLayoutUpdated()
        {
            TextServicesDisplayAttributePropertyRanges textServicesDisplayAttributePropertyRanges = this._propertyRanges as TextServicesDisplayAttributePropertyRanges;

            if (textServicesDisplayAttributePropertyRanges != null)
            {
                textServicesDisplayAttributePropertyRanges.OnLayoutUpdated();
            }
        }
Beispiel #3
0
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        /// <summary>
        ///    Calback function for TextEditSink
        ///    we track all property change here.
        /// </summary>
        internal void OnEndEdit(
            UnsafeNativeMethods.ITfContext context,
            int ecReadOnly,
            UnsafeNativeMethods.ITfEditRecord editRecord)
        {
            if (_propertyRanges == null)
            {
                _propertyRanges = new TextServicesDisplayAttributePropertyRanges(_textstore);
            }

            _propertyRanges.OnEndEdit(context, ecReadOnly, editRecord);
        }
Beispiel #4
0
        internal override void OnRange(UnsafeNativeMethods.ITfProperty property, int ecReadOnly, UnsafeNativeMethods.ITfRange range)
        {
            int int32Value = this.GetInt32Value(ecReadOnly, property, range);

            if (int32Value != 0)
            {
                TextServicesDisplayAttribute displayAttribute = TextServicesDisplayAttributePropertyRanges.GetDisplayAttribute(int32Value);
                if (displayAttribute != null)
                {
                    ITextPointer start;
                    ITextPointer end;
                    base.ConvertToTextPosition(range, out start, out end);
                    displayAttribute.Apply(start, end);
                }
            }
        }
Beispiel #5
0
        internal override void OnEndEdit(UnsafeNativeMethods.ITfContext context, int ecReadOnly, UnsafeNativeMethods.ITfEditRecord editRecord)
        {
            if (this._compositionAdorner != null)
            {
                this._compositionAdorner.Uninitialize();
                this._compositionAdorner = null;
            }
            Guid guid = base.Guid;

            UnsafeNativeMethods.ITfProperty tfProperty;
            context.GetProperty(ref guid, out tfProperty);
            UnsafeNativeMethods.IEnumTfRanges enumTfRanges;
            if (tfProperty.EnumRanges(ecReadOnly, out enumTfRanges, null) == 0)
            {
                UnsafeNativeMethods.ITfRange[] array = new UnsafeNativeMethods.ITfRange[1];
                int num;
                while (enumTfRanges.Next(1, array, out num) == 0)
                {
                    int int32Value = this.GetInt32Value(ecReadOnly, tfProperty, array[0]);
                    TextServicesDisplayAttribute displayAttribute = TextServicesDisplayAttributePropertyRanges.GetDisplayAttribute(int32Value);
                    if (displayAttribute != null && !displayAttribute.IsEmptyAttribute())
                    {
                        ITextPointer textPointer;
                        ITextPointer end;
                        base.ConvertToTextPosition(array[0], out textPointer, out end);
                        if (textPointer != null)
                        {
                            if (this._compositionAdorner == null)
                            {
                                this._compositionAdorner = new CompositionAdorner(base.TextStore.TextView);
                                this._compositionAdorner.Initialize(base.TextStore.TextView);
                            }
                            this._compositionAdorner.AddAttributeRange(textPointer, end, displayAttribute);
                        }
                    }
                    Marshal.ReleaseComObject(array[0]);
                }
                if (this._compositionAdorner != null)
                {
                    base.TextStore.RenderScope.UpdateLayout();
                    this._compositionAdorner.InvalidateAdorner();
                }
                Marshal.ReleaseComObject(enumTfRanges);
            }
            Marshal.ReleaseComObject(tfProperty);
        }
        internal void OnEndEdit(
            UnsafeNativeMethods.ITfContext context, 
            int ecReadOnly,
            UnsafeNativeMethods.ITfEditRecord editRecord)
        {
            if (_propertyRanges == null)
            {
                _propertyRanges = new TextServicesDisplayAttributePropertyRanges(_textstore);
            }

            _propertyRanges.OnEndEdit(context, ecReadOnly, editRecord);
        }