Visual studio automation

  • From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 4 Feb 2008 22:52:18 -0800


I got tired of hearing the bing and bong that shows up in the code editor
window so I am starting to fix it.  I have sent this script on to Jamal for
testing but for the people out here that have the full version of VS 2005 I
created a new SayLine.  Jamal is hopefully going to test it with express
versions but I don't' know that it will work.  What I do know is if your
using the full version of Visual studio 2005 this makes the lines read much
faster and better in the code edit window.  The reason I think you have to
use the full version for this is I am using automation to get to it.  

I have tested it as much as possible but if some of you adventuresome people
out there want to try it here is my SayLine function for the VS 2005
scripts.

Script sayline ()
var
object pacc,
object objtd,
object objep,
object objdte, 
string ln,
int lineNum

if IsVirtualPCCursor() || !IsPCCursor () then
        PerformScript SayLine()
        return
EndIf

if GetWindowClass(getFocus()) ==WC_VS_TIP_WINDOW  then 
SayField ()
return
endif


if InCodeEditor() then
let objdte=GetObject ("VisualStudio.DTE.8.0" 
)

let objtd=objdte.ActiveDocument.Object("TextDocument") 

let objep = objtd.Selection.ActivePoint.CreateEditPoint()

let ln=objep.GetLines(objep.Line,objep.Line+1)

If IsSameScript () && OutsideCaller == 0 then
                SpellString (ln);
else
                if ln  != "" then
                        say(ln, i_ot_line)
        else
                        say("blank", i_ot_line)
                Endif
EndIf
else
PerformScript SayLine()
EndIf ; InCodeEditor
EndScript


Other related posts: