Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
 public void InsertEmbeddedAtSelection(int flags, IDataObject obj, out int startIndex, out int endIndex, out TsTextchange change)
 {
     startIndex = endIndex = 0;
     change     = new TsTextchange();
     throw new COMException("", Result.NotImplemented.Code);
 }
Exemplo n.º 3
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);
 }