How do I set a breakpoint inside C# PresentationFramework.dll?
This might be a shot in the dark, but, how would I go about setting a breakpoint inside the following internal static method in PresentationFramework.dll?
System.Windows.Documents.TextEditorTyping._ShowCursor()
I've run into a very similar situation to Joe, where I am making a custo开发者_StackOverflow社区m auto-complete textbox using a TextBox control and a Popup which contains an ItemsControl. When I have the focus in the text box and the popup shown with StaysOpen="False", and type some characters, the mouse pointer is hidden (through a call to System.Windows.Documents.TextEditorTyping.HideCursor I believe). It is normally re-shown on mouse move, however it appears that the popup handles this event while it is checking whether it should hide or not, so the pointer stays hidden as you move it around the window.
There is a quirk, where on the first key press, the pointer disappears then instantly reappears, then on the second key press, the pointer stays hidden. This suggests that something is calling _ShowCursor(), and I am interested to know what. Hence this post, and the desire to set the breakpoint described above. How do I set that breakpoint?
Regarding my actual problem, the pointer staying hidden once it moves, I hope to solve it either by emulating StaysOpen="False" myself without blocking mouse move events, or to fire mouse move events myself to cause the pointer to reappear. Any other tips on this appreciated.
While you cannot do this with the stock framework (no debug symbols available,) you can get this kind of trickery working with Reflector Pro: http://www.red-gate.com/messageboard/viewforum.php?f=109
Reflector Pro will disassemble the WPF assemblies into .cs source files, and generate it's own debug PDB on the fly - you then then single-step with Visual Studio through the Presentation Framework assembly (and set breakpoints)
good luck!
I have to recommend you set the breakpoint in the source code file. It is available from the Reference Source, I very strongly recommend the Mass Downloader tool to get it. If you installed it to c:\ReferenceSource then the source code file you need will be available at c:\ReferenceSource\dd\wpf\src\FrameWork\System\Windows\Documents\TextEditorTyping.cs.
One of the great advantages of the reference source over decompiled source is that it contains source code comments. Not all of the source code is available, but very large chunks of WPF are.
John Robbins' install instructions are very good. The only hiccup I had was induced by previously having used the debugging symbols available from the Microsoft debug symbol server. I had to delete the .pdb files that are also available from the reference source from the symbol cache by hand.
It can be a bit tricky but it can be done in the following steps.
- Disable "just my code" from the debugging options menu
- Open the breakpoints window and slect break at function
- Type the full name if the funciom
For other that run in to this problem here is how I did it (VS2015):
Downloaded and installed JetBrains dotPeek
run dotPeek as a symbol server
As explained here: https://www.jetbrains.com/help/decompiler/2016.1/Using_product_as_a_Symbol_Server.html
you probably also have to delete/rename the already downloaded wrong version of PresentationFramework.pdb as explained under "Possible Problems and Solutions" in above link
精彩评论