M
MuZZy
Hi,
I'm developing an add-in for Visual Studio which works like Quick Watch in debug mode for viewing
datasets/datatables as tables.
I already have a working add-in, but there is one problem i can't find solution for:
When i select a dataset object and from context menu choose "DSWatch" (my add-in), it shows
correctly, but i need to add functionality to just put cursor on the variable instead of electing it.
What i have is:
public class Connect : Object, Extensibility.IDTExtensibility2, IDTCommandTarget,ICallback
{
public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref
object varOut, ref bool handled)
{
string str="";
DatasetWatchFrm _DatasetWatchFrm = null;
try
{
EnvDTE.Debugger debugger;
debugger = applicationObject.Debugger;
applicationObject.ActiveDocument.MarkText;
TextSelection _TextSelection;
applicationObject.ActiveDocument._TextSelection =
(TextSelection)applicationObject.ActiveDocument.Selection;
str=_TextSelection.Text ;
if ( commandName != "DSWatch.Connect.DSWatchNode")
{
m_bDataTable = true;
}
_DatasetWatchFrm =new DatasetWatchFrm(str);
string strValue = this.GetExp(str);
_DatasetWatchFrm.m_strValue = strValue;
_DatasetWatchFrm.SetParent(this);
_DatasetWatchFrm.getXml(strValue);
_DatasetWatchFrm.Show();
}
catch(Exception e)
{
_DatasetWatchFrm.Show();
System.Windows.Forms.MessageBox.Show(e.Message );
}
}
}
So i can get the selected text from IDE and then get the dataset itself,\but how do i get the text
under cursor?
Any suggestions would be highly appreciated!
Thank you in advance,
Andrey
I'm developing an add-in for Visual Studio which works like Quick Watch in debug mode for viewing
datasets/datatables as tables.
I already have a working add-in, but there is one problem i can't find solution for:
When i select a dataset object and from context menu choose "DSWatch" (my add-in), it shows
correctly, but i need to add functionality to just put cursor on the variable instead of electing it.
What i have is:
public class Connect : Object, Extensibility.IDTExtensibility2, IDTCommandTarget,ICallback
{
public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref
object varOut, ref bool handled)
{
string str="";
DatasetWatchFrm _DatasetWatchFrm = null;
try
{
EnvDTE.Debugger debugger;
debugger = applicationObject.Debugger;
applicationObject.ActiveDocument.MarkText;
TextSelection _TextSelection;
applicationObject.ActiveDocument._TextSelection =
(TextSelection)applicationObject.ActiveDocument.Selection;
str=_TextSelection.Text ;
if ( commandName != "DSWatch.Connect.DSWatchNode")
{
m_bDataTable = true;
}
_DatasetWatchFrm =new DatasetWatchFrm(str);
string strValue = this.GetExp(str);
_DatasetWatchFrm.m_strValue = strValue;
_DatasetWatchFrm.SetParent(this);
_DatasetWatchFrm.getXml(strValue);
_DatasetWatchFrm.Show();
}
catch(Exception e)
{
_DatasetWatchFrm.Show();
System.Windows.Forms.MessageBox.Show(e.Message );
}
}
}
So i can get the selected text from IDE and then get the dataset itself,\but how do i get the text
under cursor?
Any suggestions would be highly appreciated!
Thank you in advance,
Andrey