示例#1
0
 public void InsertEmbedded(int flags, int startIndex, int endIndex, TsfSharp.IDataObject dataObjectRef, out TsfSharp.TsTextchange change)
 {
     change = new TsTextchange();
     throw new COMException("", Result.NotImplemented.Code);
 }
示例#2
0
        public void InsertTextAtSelection(TsfSharp.TsIasFlags dwFlags, string pchText, uint cch, out int pacpStart, out int pacpEnd, out TsfSharp.TsTextchange pChange)
        {
            pacpStart = pacpEnd = 0;
            pChange   = new TsTextchange();

            //does the caller have a lock
            if (!_IsLocked(TsLfFlags.Readwrite))
            {
                //the caller doesn't have a lock
                throw new COMException("", (int)TsErrors.TsENolock);
            }

            int acpStart;
            int acpOldEnd;
            int acpNewEnd;

            acpOldEnd = _acpEnd;

            //set the start point after the insertion
            acpStart = _acpStart;

            //set the end point after the insertion
            acpNewEnd = _acpStart + (int)cch;

            if ((dwFlags & TsIasFlags.Queryonly) == TsIasFlags.Queryonly)
            {
                pacpStart = acpStart;
                pacpEnd   = acpOldEnd;
                return;
            }

            //insert the text
            _inputBuffer.RemoveRange(acpStart, acpOldEnd - acpStart);
            _inputBuffer.InsertRange(acpStart, pchText);

            //set the selection
            _acpStart = acpStart;
            _acpEnd   = acpNewEnd;

            if ((dwFlags & TsIasFlags.Noquery) != TsIasFlags.Noquery)
            {
                pacpStart = acpStart;
                pacpEnd   = acpNewEnd;
            }

            //set the TS_TEXTCHANGE members
            pChange.AcpStart  = acpStart;
            pChange.AcpOldEnd = acpOldEnd;
            pChange.AcpNewEnd = acpNewEnd;

            //defer the layout change notification until the document is unlocked
            _layoutChanged = true;
        }
示例#3
0
        public void SetText(int dwFlags, int acpStart, int acpEnd, string pchText, uint cch, out TsfSharp.TsTextchange change)
        {
            /*
             * dwFlags can be:
             * TS_ST_CORRECTION
             */

            //set the selection to the specified range
            TsSelectionAcp tsa = new TsSelectionAcp();

            tsa.AcpStart           = acpStart;
            tsa.AcpEnd             = acpEnd;
            tsa.Style.Ase          = TsActiveSelEnd.TsAeStart;
            tsa.Style.FInterimChar = false;

            SetSelection(1, ref tsa);

            int start, end;

            InsertTextAtSelection(TsIasFlags.Noquery, pchText, cch, out start, out end, out change);
        }