Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

c# - search for a value in an object at runtime [QuickWatch enhancement]

sometimes I waste my time searching for a value in an object at runtime.
Certainly you-all know this task --> open the QuickWatch view and browse through the properties until you find what you're looking for.

I'm looking for a tool/add-in/extension where it is possible to search for a value in object.
The QuickWatch view with a search enhancement would be perferct :)

sb. knows a tool?

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Immediate / Command window

A possible way to achieve that would be to write ? YourObject in Visual Studio's Immediate or Command window. This command will print all values of your object and you can then simply search it with Control + F.

Custom macro

Another possibility is to run a custom macro when a TracePoint was hit in Visual Studio like explained by Scott Guthrie in this excellent blog post:

The macro explained in this blog post automatically outputs all of the local variables when a TracePoint was hit, but the general idea would go in the same direction.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...