I am trying to customize debugged objects tooltips. To achieve this I have a library including Assembly: DebuggerDisplay
attributes (Can the DebuggerDisplay attribute be applied to types one doesn't own?) in Visualizers folder (How to: Install a Visualizer).
I would like to see a DataRow index so I have in vb.net
<Assembly: DebuggerDisplay("Idx = {Table.Rows.IndexOf(Me)}", Target:=GetType(DataRow))>
or in c#
[assembly: DebuggerDisplay(@"Idx = {Table.Rows.IndexOf(this)}", Target = typeof(DataRow))]
The problem is that the expression is evaluated in debug time and the object self reference (Me
x this
) is different in both languages. So I am getting
CS0103 The name 'Me' does not exist in the current context
in the tooltip when I am debugging c# code.
Is there a way to get the index of DataRow with syntax common to both languages?