Esempio n. 1
0
        public void FormatRange(LineRange range)
        {
            Reset();
            int startLine, startLineOffset, endLine, endLineOffset;

            this.GetExtentInfo(range.Start, range.Length, out startLine, out startLineOffset, out endLine, out endLineOffset);

            int oldStartLine, oldStartLineOffset, oldEndLine, oldEndLineOffset;

            _view.GetSelection(out oldStartLine, out oldStartLineOffset, out oldEndLine, out oldEndLineOffset);
            _view.SetSelection(startLine, startLineOffset, endLine, endLineOffset);
            IOleCommandTarget target = (IOleCommandTarget)ServiceProvider.GlobalProvider.GetService(typeof(SUIHostCommandDispatcher));
            Guid cmdid = VSConstants.VSStd2K;
            int  hr    = _view.SendExplicitFocus();

            hr = target.Exec(ref cmdid, (uint)VSConstants.VSStd2KCmdID.FORMATSELECTION, 0, IntPtr.Zero, IntPtr.Zero);
            _view.SetSelection(oldStartLine, oldStartLineOffset, oldEndLine, oldEndLineOffset);
        }
        public void FormatRange(LineRange range)
        {
            Reset();
            int startLine, startLineOffset, endLine, endLineOffset;
            this.GetExtentInfo(range.Start, range.Length, out startLine, out startLineOffset, out endLine, out endLineOffset);

            int oldStartLine, oldStartLineOffset, oldEndLine, oldEndLineOffset;
            _view.GetSelection(out oldStartLine, out oldStartLineOffset, out oldEndLine, out oldEndLineOffset);
            _view.SetSelection(startLine, startLineOffset, endLine, endLineOffset);
            IOleCommandTarget target = (IOleCommandTarget) ServiceProvider.GlobalProvider.GetService(typeof (SUIHostCommandDispatcher));
            Guid cmdid = VSConstants.VSStd2K;
            int hr = _view.SendExplicitFocus();
            hr = target.Exec(ref cmdid, (uint) VSConstants.VSStd2KCmdID.FORMATSELECTION, 0, IntPtr.Zero, IntPtr.Zero);
            _view.SetSelection(oldStartLine, oldStartLineOffset, oldEndLine, oldEndLineOffset);
        }
Esempio n. 3
0
 public void FormatRange(LineRange range)
 {
 }
Esempio n. 4
0
 public void FormatRange(LineRange range)
 {
 }