ASP.Net MVC Go To Declaration On view - asp.net-mvc

Is there anyway when in an MVC view to right click a function call and get to the declaration? Like you can do in the code behind/controllers

with resharper: control click on it.

Double-click to select, global find (button near the search box at the top), and then you usually have only couple of search results so you can easily see the function. If it's not in your code but in some lib, then I think you'll have to copy it, open Object Explorer, and search for it. With keyboard shortcuts not so bad; or you can write a VS macro to do it ;-)
But there's even easier way - copy, Alt-Tab to FireFox, and google for it ;-)

Related

I would need some hints with F# interactive usability

Now in VS2013 and F#3.1.1, I noticed that it is a bit cumbersome to send code to F# interactive.
There are separate menus for but no keyboard shortcuts for
sending project output as reference to F# interactive
sending project references to F# interactive
In the editor window, there is no "send whole file" to f# interactive. You have to select it all, right click and send.
It feels very unpolished. Are any faster ways of doing this?
What are your IDE workflows?
As I am righting these questions, i think about maybe using shellplus powershell integration for invoking this...
Just in case it helps: you can right click on any reference in the Solution Explorer and do 'Send reference to interactive' - or you can right click on the References node and send them all to interactive.
You can also do this in your source:
#r #"c:\mycode\myassembly.dll"
...and you can surround that with #if interactive to stop it messing up your compiles.
#if INTERACTIVE
#r #"c:\temp\myassembly.dll"
#endif
Finally you might also want to look at script files (.fsx) - googling for "f# script files" produces some useful references.
For sending references, yes, you have to right-click on the individual reference or the references node and click "Send reference to FSI." Not perfect if you prefer keyboard shortcuts, but much improved from VS 2012 when you had no choice but to type out a full #r statement every time...
For sending code, Alt+Enter is the easiest/most popular shortcut. Highlight the code you want to execute (using either mouse or keyboard), then hit Alt+Enter. To send the entire file, just use select-all (Ctrl+A) to highlight everything.

Is it possible to invoke refactoring from the Open Tools API?

The Delphi IDE has a plugin system, the Open Tools API. The IDE also has a number of refactorings available, such as a rename refactoring to rename a field, method, etc - an identifier.
Is it possible to invoke this, or any, refactorings from the OTAPI? If not, is there a hacky way to do it?
My research shows no mentions of refactorings in ToolsAPI.pas, but I don't want to give up with "No." It doesn't mean there isn't a way to do it - it just means I don't know what it is :)
There is no support at all from OTA. Therefore your only hope is to hunt down the menu items or actions, invoke their OnClick or OnExecute handlers, poke values into the dialogs that are shown, and then programmatically press the dialog OK buttons.

How can I add a button to Windows Explorer. (not to IE)

I want to add a button to Win Exp. toolbar and run a script file with the button. How can I do it in Delphi? Or may be Win API?
Yes, all you need is to write a toolbar for Explorer :). There are a lot of articles about implementation of the toolbar:
one
two
three
four (in delphi)
Perhaps the Shell+ (ShellPlus) components could help with this? (Not proven myself -- just a thought to research). I do believe they will let you add a new toolbar, at the very least, modify the right-click menu. What kind of script are you needing to run?

Delphi 7 - Embedded file open dialog in a form

Does anyone know if it is possible to embed a file open dialog inside your own form?
We have a tabbed dialog and on one of the tabs we want the user to be able to browse for a file with the same functionality as the the standard open dialog e.g. 'Look in' combobox, places bar, shell file list, file name comboedit with name completion etc etc.
I've looked at recreating the dialog with some 3rd party components, namely Jam Shell Browser Components
I can get most of the functionality this way, but I'm missing a couple of things e.g. the places bar and the filename auto completion\suggestion
I don't want to say it's impossible but considering the amount of ugly winapi hacks you'd probably involve I suggest "recreating the dialog with some 3rd party components" but with VirtualShellTools.
VirtualShellTools can be downloaded from this SVN archive.
And here's the google code project page.
(At least it has the filename autocompletion combobox though i am not sure if it has the places bar). Hope it helps.
The places bar is not that difficult to implement using a TListView component set to large icons. The Raize Components library also has some source that would help in this arena.
Just a small note, it's fairly easy to add an auto-completing combobox with SHAutoComplete.
See this article for details.
Maybe this Shell Controls Demo can help you.
Edit: ATM the site seems to be down. The Wayback Machine helps.
Here's the latest download link for the controls involved from the wayback machine:
I would re-create it: it shouldn't take long with the VCL Components. The autocomplete is not hard, and you can get the rest of the data if you look through the windows docs long enough.
You can try and cheat by detecting the tab change and displaying the open dialog as if it were the tab page. You will have to detect the user clicking outside of the dialog (e.g. on a different tab) and prevent it closing until you want to change tabs.
Cheers

"Rename control" in Delphi 7?

Following up on this question, I'm working on a large Delphi 7 codebase which was not written very nicely.
I'm looking at code like this, as a small example:
if FMode=mdCredit then begin
Panel8.Caption:='Credit';
SpeedButton3.Enabled:=false;
SpeedButton4.Enabled:=false;
SpeedButton5.Enabled:=false;
SpeedButton5.Enabled:=false;
SpeedButton6.Visible:=False;
SpeedButton10.Visible:=False;
end;
Followed by another 6 very similar blocks. The whole thing is in this style.
So I'm thinking that this would be much easier to read if the controls were named sensibly.
I could just use a global search and replace, but I'll run into problems when multiple forms use the same names, and also I'd have to be careful to change (eg) SpeedButton10 before SpeedButton1.
Is there some plugin which has the ability to perform a "smart" rename for me?
Edit:
Sorry, I should have mentioned this before: I tried both GExperts and Castalia's "Rename Component" feature, but they both seem to be intended for use when adding the component to the form initially.
They don't do a search+replace in the code, or rename existing events (SpeedButtonXClick() -> cmdCreditClick()).
Have I missed something?
Not exactly a plug-in, but you can use one of the more recent versions of Delphi and the refactoring feature in there. Maybe you could use the free Turbo Edition . . .
You might try ModelMaker for Delphi 7. It has refactoring support that might work for you.
The Rename Symbol refactoring in recent Delphi versions will work across units in a project. Since you say Delphi 7 I guess that's not going to help you, and in the past I've just used TextPad, a great editor that (like many others) will do powerful search/replace across files (with or without confirmation).
HTH
Edit: Craig's right - GExperts will do this, as will Castalia.
I think GExperts has a search and replace like this.
Don't know if it can work in your case, but you could try to load your project in a later version of Delphi that has the refactoring capability and use it to change the components names while taking care of all the dependencies. Then you just have to do a diff and see what has been changed.
Why not use Sync Edit? Its part of the IDE (at least in 2006+):
The Sync Edit feature lets you simultaneously edit indentical identifiers in selected code. For example, in a procedure that contains three occurrences of label1, you can edit just the first occurrence and all the other occurrences will change automatically.
(copied from the BDS2006 Help)
You will have to rename your components first, but it takes the pain out of most of this. I prefer the GExperts wizard of renaming components as they are added to the form, but as you pointed out, it only works when the component is added to the form, and doesn't reach into the individual usages of the components in code. The reason for the renaming of the components first is that when you select the entire block of code to do the rename, it won't make the appropriate changes in the dfm file...just your locally selected code block.
To use the feature, select your entire implementation block, then press the button in the gutter that has two pencils "linked" by a line...then press tab until you get the first one you want to edit...when you change its name, it will change globally in the rest of your source file. Press ESC when your done.

Resources