stateprinter

Using StatePrinter from VB rather than C# to implement ToString

亡梦爱人 提交于 2019-12-23 01:42:06
问题 I'm trying to follow the promising suggestion posted here to try StatePrinter as a shortcut to rolling my own ToString methods. I agree with the OP that it is a shame that VS still can't generate this method for me. I've got a fairly large project, in VS2015 (Community Edition), with both VB and C# code. I added the current stable version of StatePrinter using NuGet. I can make the example code from the SO answer work fine in my C# code but when I do what I think is the equivalent in my VB

Configure StatePrinter to only follow the declared types?

烂漫一生 提交于 2019-12-13 19:34:46
问题 I'm using Stateprinter to print/compare my types. It works quite nicely, however, it does compare the actual type of each (sub) object instead of the declared type of the subobject. An example: class X { string Foo; int Bar; } interface IMyData { public X MyConfig { get; } } Now, when calling: var cfg = ConfigurationHelper.GetStandardConfiguration(); cfg.Add(new PublicFieldsAndPropertiesHarvester()); var printer = new Stateprinter(cfg); // ... IMyData v = new MyDataWithMoreStuff(); printer

Using StatePrinter from VB rather than C# to implement ToString

懵懂的女人 提交于 2019-12-09 04:04:27
I'm trying to follow the promising suggestion posted here to try StatePrinter as a shortcut to rolling my own ToString methods. I agree with the OP that it is a shame that VS still can't generate this method for me. I've got a fairly large project, in VS2015 (Community Edition), with both VB and C# code. I added the current stable version of StatePrinter using NuGet. I can make the example code from the SO answer work fine in my C# code but when I do what I think is the equivalent in my VB code: Private Shared sp As StatePrinter.Stateprinter = New StatePrinter.Stateprinter Public Overrides