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); }
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; }
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); }