Trying to get a DataRow[] Debugger Visualizer to work in Visual Studio 2010 -
Trying to get a DataRow[] Debugger Visualizer to work in Visual Studio 2010 -
i'm trying datarow[] debuggervisualizer working visualstudio 2010 , unfortunately can't work work. i'm able datarow 1 working not datarow[], love please?
the meat of code here.
class="lang-cs prettyprint-override"> [assembly: debuggervisualizer( typeof( pchenry.dr ), typeof( pchenry.drobjectsource ), target = typeof( datarow[] ), description = "datarow array debugger visualizer (or if see it's working yahoo!)" )] namespace pchenry { public class dr : dialogdebuggervisualizer { protected override void show( idialogvisualizerservice windowservice, ivisualizerobjectprovider objectprovider ) { stringbuilder stringtodebug = new stringbuilder(); using( stream datastream = objectprovider.getdata() ) { binaryformatter formatter = new binaryformatter(); string incomingdata = formatter.deserialize( datastream ) string; stringtodebug.append( string.format( "*!!!!{0}!!!!*", incomingdata ) ); } messagebox.show( stringtodebug.tostring(), "pch string debugger visualizer", messageboxbuttons.ok, messageboxicon.asterisk ); } } public class drobjectsource : visualizerobjectsource { public override void getdata( object target, stream outgoingdata ) { if( target != null && target datarow[] ) { datarow[] rows = target datarow[]; binaryformatter formatter = new binaryformatter(); //formatter.serialize( outgoingdata, target ); formatter.serialize( outgoingdata, string.format( "there {0} rows of data", rows.length ) ); } } } }
as hope can see, i'm trying set target correctly, it's not beingness used vs @ runtime/debugging time. yes, copying dlls right visualizers directory. in fact, i'm using buildevent work me.
xcopy "$(solutiondir)$(projectname)\$(outdir)$(targetfilename)" "$(userprofile)\documents\visual studio 2010\visualizers" /y
when test this, utilize this.
class="lang-cs prettyprint-override"> static void main( string[] args ) { //string myname = "peter henry"; #region datasetup, create habs datatable , populate players datatable table = new datatable( "habs" ); table.columns.add( "playernumber", typeof( int32 ) ); table.columns.add( "playername", typeof( string ) ); table.columns.add( "position", typeof( string ) ); //team current 09-23-2010 canadiens! go habs go! table.rows.add( new object[] { 32, "travis moen", "f" } ); table.rows.add( new object[] { 94, "tom pyatt", "f" } ); table.rows.add( new object[] { 75, "hal gill", "d" } ); table.rows.add( new object[] { 26, "josh gorges", "d" } ); table.rows.add( new object[] { 76, "p.k. subban", "d" } ); table.rows.add( new object[] { 35, "alex auld", "g" } ); #endregion //use show debugger in 2 different ways datarow[] defencemen = table.select( "position = 'd'", "playernumber" ); //this proves works when told objectsource utilize visualizerdevelopmenthost host = new visualizerdevelopmenthost( defencemen, typeof( pchenry.dr ), typeof( pchenry.drobjectsource ) ); host.showvisualizer(); //but when seek utilize vs debugging here, can't seem find custom debuggervisualizer expect defencemen = table.select( "position = 'd'", "playernumber" ); debugger.break(); console.writeline( "fin" ); console.readline(); }
the key here is, visualizerdevelopmenthost works correctly, , can guess cause it's told visualizerobjectsource use. when nail debugger.break(); line , seek utilize normal, can't see magnifying glass defencemen datarow[].
i believe in bottom of heart can done. read on msdn datarow couldn't done, got work. hope can help me out there working.
thank much guys replies. confirmed thinking (well, coming realize after 4 nights of fighting it!). again. blogged , referenced information. give thanks much time.
visual studio debugger visualizers (take three)
for part spike says true. can write visualizer "except object or array": http://msdn.microsoft.com/en-us/library/e2zc529c.aspx
"array" seems little ambiguous; there's lots of people same problem...
i haven't been able find specific (and haven't tried it) but, ienumerable? work?
there's interesting article of getting around limitations on types of objects visualizer can except here: http://joshsmithonwpf.wordpress.com/2008/01/20/the-rock-star-hack-of-2008/
visual-studio visual-studio-2010
Comments
Post a Comment