When you add a new view to an ASP.NET MVC project you can strongly type the view by selecting which model class it should work with in the dialog box. The problem is in that drop down menu it includes all the classes and interfaces from all referenced projects and dlls. So, I see all the Ninject classes, all the interfaces for my services, etc in that menu. Is there any way to specify which namespaces to include or a list of namespaces to exclude from that drop down menu?
I realize that this is not a big deal and you can just start typing the name of the class in the box and it will pull up the right one. I just thought that if there was a place for this it would be nice. If there isn't, no big deal but I thought I would ask. :)
If you really really want this and you are cool with some hacking, try this :)
c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Microsoft.VisualStudio.Web.Mvc.3.01.dll
decompile it - you will find MvcAddViewDialog class, and the GetTypes method in it. Put some filtering in it, recompile, replace, enjoy... but personally, I probably wouldnt :)
Related
In MVC you are likely to have many views with the same name (such as Index.cshtml or Edit.aspx) for the various controllers.
Depending on your working style, you might end up with a few tabs open in Visual Studio ending up with a tablist that looks like:
Index.cshtml|Index.cshtml|SomeController.cs|Edit.cshtml|Index.cshtml|Edit.cshtml|
It is possible to hover over the tabs and wait for the context hint to show up, but I was wondering if anyone had a technique or plugin where the correct file could be more easily identified at a glance (i.e. the Index.cshtml for the SomeController)?
There may be an extension in the Visual Studio 2010 Pro Power Tools that will make your life easier. The Document Well 2010 Plus allows you to configure the document tabs.
I think http://www.tabsstudio.com/ may have the behavior you are looking for.
When you install it you should open the 'Tabs Studio Add-in Manager' and check 'Disambiguator'.
When you have different files open with the same name, it will display it's containing folder.
Home/Index.html | About/Index.html
I've got a base form in Delphi 2007 that I'd like to reuse in another project, adding some other buttons and such.
I'm familiar with subclassing a non-GUI object, but it is possible to subclass a Form in the same fashion? Can you make changes to the subclass Form in design mode?
How do you go about doing this and what are some things to look out for?
As idursun said (he was a little quicker than me):
Add the base form to your new project.
Then choose "File\New\More..."
Form the "Delphi-Projects" branch select "Inheritable Elements", find your base form and click "OK".
(The actual names of the menu items may vary since I am using a german version of Delphi 2009)
You can then make changes to your new or your base form.
If I do so I make sure to have both forms open in the IDE since sometimes it seems Delphi doesn't get all the changes if I don't.
You should add your base form to your new project and in the new form window there should be an Inherit tab where you can select a base form for the new form.
I need to switch every control of a particular type on a form to a different type while maintaining the name and the code associated with each control.
For example, let's say I need to switch a dozen or more TEdit fields to TSpinEdits. How can I do that in Delphi 2007 with minimal effort?
Use the GExperts Replace Components expert. It's free, and is the only tool I've seen that does what you're asking, including mapping properties from the old component to the new one.
If you don't feel like using any external tools, you could always try switching to view the form as text, then search and replace TEdit to TSpinEdit. When you switch back and save the form, the IDE should tell you that the declarations in the .pas file are incorrect and offer to correct them automatically. Property mappings shouldn't be a problem unless there are properties that are named differently that you want to map from one class to the other. Properties that don't exist on the new class will be deleted. This is how it works in Delphi 7 anyway...
If you're not happy with the results, you might try GExperts as recommended by Craig, which are a great addition to the IDE for many reasons.
I use the CNTools component replacer (couldn't find the one in GExperts), it's got a good Component Selector feature too so you can select multiple controls based one some simple queries.
I like the new Add View dialog that was released with RC1. If you specify a view data class, it generates a scaffolded view for you. It seems to work fine with classes defined in projects within my solution. Some of my domain classes inherit from a base class that is defined in an external assembly (and referenced in my web project). I get an error when I specify one of these domain classes. Visual Studio is reporting a TypeLoadException on the external base class.
I did a little debugging with ProcMon and found that it was looking for the base class DLL in, among other places, a temporary folder. That folder did contain the DLL containing my derived domain model class. I did not see the base class's DLL. So for fun, I copied it there and voila, I could add the view.
Is this a bug?
Yes this is a bug. Please file it on http://codeplex.com/aspnet
you actually forgot to add the Web.Config file on the View Folder.
See this small article : http://www.graytechnology.com/Blog/post/ASPNET-MVC-strongly-typed-view-error-Could-not-load-type.aspx
It got me scratching my head quite a bit as well in my current project! :)
Remember the old class hierarchy posters that used to come w/Delphi?
I'm wanting a full class hierarchy browser for ALL my Delphi classes, including the custom ones I've built and installed on the palette, plus third-party components. Ideally easily searchable by class name (including "whole word only" searches, so partial matches don't count).
I've only seen two things that come close:
1) GExpets Class Browser - Works great, BUT doesn't automatically load ALL installed components / classes, which is what I want. You have to import all the source units manually, as far as I can tell.... which can be quite a hassle. It also doesn't allow "whole word only" searches, so sometimes searching for a class w/a common "sub name" takes forever.
2) Eagle / DevExpress CDK - It loads the full class list automatically, and seems to work brilliantly, but it's only usable in D7 and prior, and it's not really focused on being a class browser per se, so much as an "inherit from" chooser.
Is there anything out there which does this already? If not, how difficult would it be to write an app that, at bare minimum, builds a self-referencing class-name table, so I could at least throw it into a database / treeview component to easily view inheritance / ancestry, etc.?
I think ModelMaker Code Explorer has this feature, but I don't use it
ESSModel is another nice class browser tool, and it's open source. I don't know if there's any way to get it to load a list of units automatically. Not sure, but you may be able to manually import all the units you want and then save that as a base project that you start from with all your individual projects. Not sure how performance would be with that much loaded, or how easy it to view the part(s) you want.
http://essmodel.sourceforge.net/
Assuming you need a Delphi IDE Expert (you've mentioned somewhere in your post: "...installed on the palette, plus third-party components"), DelphiDiver is good for you (Source code available on the DelphiPraxis, registration needed).
Look and feel:
If you feel like delving into the IDE in order to get more indepth details, click Inspect the IDE hence the name of the Expert (DelphiDiver) ;-)
Click Inspect the Packages so as to browse any other third party component(s) or whatever package(s)/component(s) you've installed.
It makes use of the advanced RTTI and requires Delphi 2010 version onward.
I've personally installed it using Delphi XE on my box.
I hope it can serve as a base for the more focused Full VCL Class Browser you are looking for.