Comments
7 comments
-
That functionality still seems to work in my Snippy Addin. Try getting the source code from http://reflectoraddins.codeplex.com/Sou ... mmits.aspx ... the latest will work for what you need (I wouldn't try to build it if I were you).
Once you get that downloaded look for the RemoteController project and the file named RemoteController.cs That has the function SendCopyDataMessage(string message).
If you look at the source for the SnippyAddin (http://jasonhaley.com/blog/post/2009/01 ... ted-(v0930).aspx) look at the BuildCommand.Run().
It selects the Main(string[]) method of the given assembly in the AssemblyBrowser. -
I forgot to mention, you'll need to know how to format the code:// path to what you want to select. If you need help with that, the fastest way is to have Reflector bookmark what you want to have the code:// path to and then close Reflector. In the directory that Reflector.exe is in, look at the Reflector.cfg file for the BookmarkManager section ... that will have your code:// ... string in it for you.
If you want some code you can use to create the code:// path, Lutz provided some awhile back on codeplex (file named CodeIdentifier.cs) which I use in my CodeShortcut addin (you can get it from http://jasonhaley.com/addins/) -
Hi Jason,
There were indeed two problems in Hawkeye source code:
- Reflector's window title is not any more "Lutz Roeder's .NET Reflector" byut "Red Gate's .NET Reflector". Easy to fix!
- The second one is due to the fact that now, Reflector is displaying the currently loaded list. So the real window title is "Red Gate's .NET Reflector - [My list]" if a non default assembly list is loaded.
This second issue is fixed in Snippy's code: instead of using the Win32 API FindWindow (which only accepts the window text), you make use of EnumWindows along with a callback that checks that the window title starts with "Red Gate's .NET Reflector". All this is sufficient to have Hawkeye work correctly.
Just for your information, Hawkeye isn't using the "code://" syntax to select elements: instead it first selects the target assembly, and then it uses a "X:Name" syntax where X can be either P, E, F or M respectively for Properties, Events, Fields and Methods. And this too works correctly.
It also uses a different way to select an assembly. By what I could see by - following your advice - examining the bookmarks, the assemblies are specified that way: Assembly Name:Version:Public Key Token. For his part, Hawkeye is directly specifying the complete path to a file. I don't know which way is the best.
And to finish with this story. I gonna post a patch (or update the source code) on Hawkeye codeplex's site using the latest version of RemoteController. As soon as this is done, I post a message in here.
PS: your post led me to install your addin into Reflector. And I don't think I'll remove it: it's pretty useful. Thank you for this. -
Good to hear you figured out your roadblock. Once you get the code updated, I'll have to take a look at it. Always nice to see other ways of doing things.
-
I've submitted a patch on Hawkeye codeplex's site. Here it is: http://hawkeye.codeplex.com/SourceContr ... hList.aspx
If you want to test this tool (which is definitely a must-have for every .NET programmer) you can either download the binaries or the sources. With the latter, if you apply the patch I submitted, you'll have the "Show source code in Reflector" button work.
PS: I hope the patch will be validated and integrated soon in the release build, but the project doesn't seem to be very active these days. If things don't change maybe I'll ask the project coordinator to be part of his dev team.
Once again, thanks for your help. -
I'd like to try the Hawkeye patch. Can you point me to the patched binaries download so I can try it out? Thank you very much!
-
I'm sorry, but I am just a guest on this project. And so, I can't generate a new release on codeplex. When I find time, I may post the patched binaries on a share site (or on a gmail account).
Add comment
Please sign in to leave a comment.
There is one functionality of Hawkeye that used to work: if Reflector was running, Hawkeye was able to open the selected .NET control inside Reflector.
This doesn't work any more, and Hawkeye says to me that I probably either didn't start Reflector or have a version older than 4.0.0.0 ...
Now that Hawkeye's source code is released, I debugged into it and I could see that first Hawkeye is trying to detect a window whose title is "Lutz Roeder's .NET Reflector". I fixed this, but then I'm stuck later on.
It seems that Reflector (as of version 4) was exposing an API through a custom Window message (0x4A). By passing text commands into lParam such as "SelectFieldDeclaration\n", one is able to drive Reflector from another process.
Here is the Hawkeye piece of code that sends messages to Reflector along with a sample command:
Does this API still exist? Is it documented somewhere? [/code]