Beispiel #1
0
        public bool DocumentSetText(string text)
        {
            IVsTextLines VsTxtlines = TextLines;

            if (VsTxtlines == null)
            {
                return(false);
            }
            bool     Result = false;
            GCHandle handle = GCHandle.Alloc(text, GCHandleType.Pinned);

            try
            {
                TextSpan[] span = new TextSpan[1];
                int        line, col;
                Int32      result = VsTxtlines.GetLastLineIndex(out line, out col);
                if (result == VSConstants.S_OK)
                {
                    result = VsTxtlines.ReloadLines(0, 0, line, col, handle.AddrOfPinnedObject(), text.Length, span);
                }
                if (result == VSConstants.S_OK)
                {
                    Result = true;
                }
            }
            finally
            {
                handle.Free();
            }
            return(Result);
        }
Beispiel #2
0
 public int ReloadLines(
     int iStartLine, int iStartIndex, int iEndLine, int iEndIndex, IntPtr pszText, int iNewLen, TextSpan[] pChangedSpan)
 {
     return(_textBuffer.ReloadLines(iStartLine, iStartIndex, iEndLine, iEndIndex, pszText, iNewLen, pChangedSpan));
 }