Enable design mode of an sln project in SharpDevelop - c#

I've been given a folder with many .cs files and a .sln to work on with the express interest of designing a GUI for the entire project. The only problem is, I don't know how.
I have both Visual Studio 2010 and SharpDevelop 4.4 at my disposal; though I'd like to learn both evenly if possible, because I like open-source IDEs, but value experience in Visual Studio as well.
I can't find any information on how to enable design mode in this situation because of how narrow my experience is with the tools; You see, I know to right-click on a .cs file in order to view its code or design in Visual Studio 2010... but that isn't available here. The only item I can see is "view code", which is not what I'm trying to do.
If I can't enable the form, I'm wondering if I can just... create a new one? Since one does not exist?
Thank you for your help.
EDIT: A screenshot of what I see (blurred for security)

Abstract answer
The designer only makes sense for some types of files. For example, Windows Forms designer exists for classes that inherit System.Windows.Forms.Control, and when the relevant attributes for that file are set in the project.
Practical answer
Make sure you have a project that allows Forms (like "Windows Forms Application" or "Windows Forms Control Library"), create one if needed.
In project tree, right-click on the project and use some "add new ..." in the context menu.
There, choose "Form" or "Control" depending on your intent. It should create and configure what's needed, and you'll be able to use the designer.
In Visual Studio you can switch between text and designer with a shortcut key (F7, Shift-F7) or context menu. In sharpdevelop use the "Source" and "Design" tabs.

In SharpDevelop if there is a designer available for the file then you can open the designer by:
Open the file into the text editor.
Click the Design tab at the bottom of the text editor.

Related

Understanding project types in a Visual Studio web application

I'm trying to make some changes to an old ASP.NET Web Application project developed by someone a couple years ago in VS2015. The project seems to comprise of many subprojects. In the following image, the icon of each subproject seems to indicate a specific type of the project. Could someone please explain each of these types by looking at the icon?
Visual Studio displays different icons for some "special" project types, which obtained from its internal GUID in the project file, and assigned when created from the proper templates. In the screenshot, they mean:
A window with a globe: Web application. A project that serves a dynamic ASP.NET web page.
A window with an Erlenmeyer flask: Test project. A project that contains unit tests authored with the MsTest framework.
A box with the C# legend: Everything else. It can be a class library, a normal windows or console program, or any other project that Visual Studio doesn't recognizes, but always writen in the C# language.
A window with the Visual Studio logo: The loaded solution containing all other projects.
However, don't put too much faith in those icons being representative of anything meaningful. They appear when you use the suggested procedures in Visual Studio to create them, but if you deviate enough from the tutorials, they'll all end up showing generic icons. Therefore use descriptive names for them.
Since you have the solution, you could right click on the project, then on the application (first option), see whats under output type: That should give you more info.
One with c# icon is either class library or win form or wpf (check output in prop)
one with flask icon is some kind of unit test project
one with circle/world is a asp.net web app (.net framework)
By the way, if you have other project icons, you could open add new project window in visual studio (by right clicking on the solution, then add, then new project OR from the menu File.New.Project) and go through the list and compare. It may not be efficient, but there aren't many project types anyway.

Developing for ASP.Net MVC, Visual Studio tab names are meaningless

For all Visual Studio ASP.Net MVC developers - I'm sure you've faced this problem before:
In each one of my controllers, there is usually an Index, Create, Edit and Detail views. All of the default view files generated by ASP.Net's scaffolding are all given the same name, for example: index.cshtml. Granted, they're in different folders.
So it's really easy to get lost in Visual Studio when you have four or five tabs open, all with the same name! Is there a way/plugin to get visual studio show me something more meaningful, such as the controller name/view folder? Or do you developers just rename all of your files once they're generated? I already have resharper so bonus points if it's possible with that.
FYI If you just hover over the tab, it tells you what View/Folder it is in. That's one way to differentiate between the different tabs.
I use this plugin https://visualstudiogallery.msdn.microsoft.com/2e8ebfe4-023f-4c4d-9b7a-d05bbc5cb239 with VS2013 and VS Community 2015.
What I usually do so far is Ctrl+N with resharper:
The Productivity Power Tools extension has a custom document well that lets you color code the tabs. It is usually used to color code them by the project they are in, but it also allows you to use custom regex. You could disable the project based color coding and add custom regexes to color any document tab with "Edit" in the path Blue, and documents with "Create" Green, etc... You will need to turn on the option for "Use full document path for regular expression matching" under the "advanced" tab of the power tool options.
The VS add-in Tabs Studio works for me.
After installing open the Tab Studio add-in manager and select the Disambiguator add-in, i.e.:
Will then give you tabs like this:
Note: it costs $49 after the 30 day trial...

Visual Studio "document outline" for C# file

In Visual Studio (2013/2015/2017), the Document Outline window for C# files is always empty ("There are no items to show for the selected document.").
It seems that this functionality is not (not yet / no more) implemented.
But then, how do I view the structure of the file? Is there any extension which implements this functionality?
showing only the selected/opened file
show regions
move/rename members
show documentation
Using the Solution Explorer and Class View are NOT the solution.
In the old Visual Studio 2003, I did use a self written Add-In, because it was easy to read the structure. (There were also other tools but I cannot find them anymore). So I ask here which solution you know. :-)
EDIT: Similar question also found:
How to show code outline in Visual Studio?
UPDATE: After 10 years the feature has finally arrived in VS 2022
This feature has been added in Visual Studio 2022 17.4.0:
You can now easily view a file’s structure at a glance in the Document Outline window. The Document Outline window displays the symbol tree of the file in the editor helping you quickly navigate and edit project files. You can open Document Outline by going to View > Other Windows > Document Outline or by using the shortcut Ctrl+Alt+T.
Update: This feature was disabled in v17.4.4 for the following reason:
After we released 17.4, we found some significant performance problems with the C# implementation of Document Outline that we didn’t catch during preview usage. We’ve temporarily disabled the feature, and are spending more time working on it to address these issues. These changes are larger than we’d usually like to include in a revision release, and need more bake time, so 17.4.3 [sic] onwards & 17.5 will both ship with the feature disabled. I know this is disappointing, but we have it back in no time and enabled in a future VS update.
There is also CodeMaid which provides the same functionality as JetBrains Resharper, but is free.
The best solution I found at present is:
JetBrains ReSharper (v8.0+) has a File Structure window which shows the structure of the current file as tree (types/members) and regions are also supported.
If you don´t have ReSharper, you can´t miss the Productivity Power Tools, made by Microsoft itself.
There's a specific version for each of Visual Studio versions. More info on these links:
VS2013
VS2012
VS2010
They have a feature called Solution Navigator
Also, there's this one that seems very interesting for bring alot of cool customizations to Visual Studio IDE, called VSCommands. It's worth to checkout their website => http://vscommands.squaredinfinity.com/features
It helps you look at the nested structure of certain types of files, e.g. windows forms designer file, open a form designer you should see all controls on the form shown in nested structure in the document outline window.

Visual Studio Class Diagram Viewer stand alone

Visual Studio Makes Class diagrams and if we open it in text editor program it is a simple XML. Surely we can generate that on runtime. But the problem is although you have visual studio to see the Class Diagram Generated but what solution is there if we want to deploy application where there is no Visual Studio Installed?
Is there any possibility or available plugin or library that can generate Class diagram or UML diagram from XML?
Can we somehow use Visual Studio Class Diagram to view it on runtime?
Not Sure but what if we generate xml on Back end and then if possible create Image (png or gif) using some builtin plugin and display that? (I am really not sure about this idea :()
I have seen NClass It is very good but a bit complex and it is not developed through XML.
I suggest to use PowerToys for Class Designer (http://modeling.codeplex.com). It improves the Class Designer and allows you to export diagrams to HTML. This way is easy to distribute to any machine.
As an alternative, you can take a different path with reflection, in this case you don't need the visual studio class diagram; the diagrams are generated by inspecting the requested types. I suggest to read the articles by Sacha Barber (http://www.codeproject.com/Articles/17823/100-Reflective-Class-Diagram-Creation-Tool and http://www.codeproject.com/Articles/207280/200-Reflective-Class-Diagram-Creation-Tool). Maybe you can customize his application.
In Visual Studio Enterprise 2017:
Quit Visual Studio if it is running
Start Visual Studio Installer
Click dropdown list "More" and select "Modify"
In section "Code tools", check the option for "Class Designer"
Click button: Modify
Result: now the Class Diagram should load from Solution Explorer as UML.

Creating Windows Installer Project in Visual Studio

I've been struggling with Visual Studio to create a windows installer msi.
This is what I was hoping to create in the msi:
Installer opens and first page has a couple fields where you can enter various config locations, including being able to browse, and also some drop downs with various config setups.
Click Next or Finish or whatever and custom C# code I have written gets executed depending on the choices chosen by the user.
When looking at the Visual Studio Installer Project, I can add a dialog, but they are all predefined for me. I was hoping for something like when you create a Windows Forms Application.
Is this not possible? Is the windows installer project just that inflexible? What are my other options in Visual Studio (note I don't want to use another program that may be out there)?
The Installer class gives you a way to take get full control of what happens during installation for a VS installation project. However, you would have to use a modal dialog to collect the information you're describing, so the user experiecne would not be as smooth as an integrated wizard page.
I strongly suggest you to take a look into WIX.
It is more complex than VS install projects but it is much more flexible also

Categories

Resources