I have code a Visual 2008 project. It have finished.
Now, my customer want document includes UML diagrams.
So, Can i switch automatically these code to UML something like class diagram or sequence diagram?
You can create class diagram out of existing code quite easily. Here is a good link to MSDN:
http://msdn.microsoft.com/en-us/library/vstudio/ff657806.aspx
Right-click on the project node in the solution explorer and add a new item. Choose Class Diagram. You can now drag class files onto the designer. You can arrange them, and show property->type associations.
Related
I want to reverse engineer a current c# Project at work. I was told to use enterprise architect. But where can I select to import the source code? I am using Version 10 Corporate Edition and it seems to me there are big differences to earlier Versions. When I select a Project there are no Options like "Code Engineering" as I have seen in many youtube videos or text tutorials.
The top-most level in the model tree consists of one or more "root nodes", sometimes referred to as "models" in the help file. One of these is created when the project is created, by default it is called "Model".
This level is only for organizing model packages and is very restricted in what you can do with it. You cannot place diagrams or classes directly under a root node, and you cannot reverse-engineer code to a root node. Root nodes are not, strictly speaking, UML packages.
Instead, you must create a package in the root node. The first level below the root is called "view", but view packages are regular UML packages and you can do anything with them, including show them in diagrams, draw connectors to them and import code into them.
When you create a view, EA asks you what icon to display. This is GUI sugar only, and has no effect on what you can place inside the package.
The thing to keep in mind is that while you can move regular packages freely around the tree if you want, you cannot move root nodes or view packages to other levels. In other words, you cannot turn a view into a root node and you cannot place a view inside another view. For this reason, it might be a good idea to create a regular package inside your view before you import your code.
So: create a view inside the "Model" root node, and preferably another package in the view. You will be able to import code into either.
Addendum after the screenshot was added:
You need at least the Professional license to do code engineering at all. If you've got that, you're either working in a project where you don't have the necessary privileges to do reverse engineering (and need to contact the project administrator to get it), or you've selected a command set that doesn't include it.
EA 10, on first start after installation, asks if you wish to customize the GUI. This actually means that a number of menu items are removed. If you can't find a menu item, go to View -- Workspaces and Commands -- Commands, and select Complete.
Solved it. Somehow some options were hidden in the default profile .... great. Reconfigured the profile and now it works.
Thanks anyway
When you are typing with Intellisense and it shows you the parameters within a class, you can select a parameter and keep going until you arrive at the base level. When you are debugging, Visual Studio lets you stop on objects and inspect all of the parameters or fields within them.
Is there a way to build a treeview or diagram of all of the class parameters? I have a large class that included ton of sub objects and properties and I would like to build a view of all of its properties.
If you are just talking about being able to visualize your classes (through Visual Studio, not actually building a hierarchy through code) you can do it like this: In Visual Studio, click View - Class View. This will give you a tree view of your classes.
If you click View - Object Browser you will see a tree view of classes in other assemblies too, not just your classes.
EDIT
I think you are looking for something like the Solution Navigator in the Productivity Power Tools Visual Studio extension. Click Tools - Extension Manager - Online Gallery. Search for Productivity Power Tools and install it. You will then see an option under the View menu for the Solution Navigator.
If you want control over the way variable values are displayed during Visual Studio debugging sessions, you can apply the DebuggerDisplay attribute to the class of interest. You can alternatively overload ToString() on the class of interest to print the info you desire, assuming that this behavior would not conflict with any other requirements you may have.
I use Java Eclipse and I like how I can toggle between Sorted/Unsorted view of the methods and fields. Unsorted makes it easier to navigate the Source code as-is.
However, Visual Studio 2010 doesn't allow unsorted view intutively in its Class View pane.
Instead, it has other ways to sort:
Does anyone know how to put the Class View in unsorted view?
You can use one of the new features of VSCommands to do something similar - display the methods / fields / properties as they appear in the code file with the File Structure window.
Hope this helps.
Not sure the best way to achieve this and I would like your input.
I would like to generate a View - a ViewModel and another couple of classes.
I don't want to generate a project but just some classes.
Implementing the IWizard can you generate more than one class at one time?
Ideally I would like the user to click on a template in visual studio ,input some names etc... and generate this 4-5 classes for them.
What is the best to achieve this? Any links or suggestions on approach?
Thanks.
I would suggest using a T4 template. The engine's built right in to Visual Studio 2010, and there's a good free editor you can get through the Extension Manager (Tools > Extension Manager > Online > Search for "tangible T4").
As for how to code the templates, here's a good blog post on it which will get you started:
http://www.olegsych.com/2007/12/text-template-transformation-toolkit/
There's some info in MSDN too: http://msdn.microsoft.com/en-us/library/bb126445.aspx
Is there any add-in for VS2008 Pro that provides me the ability to expand and see the list of members of each class - methods, properties,etc... - by expanding its tree node in Solution Explorer?
not possible from solution explorer, but is available via the Class View. go to the View menu and click on Class View to open it up.
Object Browser?
http://msdn.microsoft.com/en-us/library/exy1facf%28VS.80%29.aspx
In Solution Explorer you can click either on the project or individual file and select 'View Class Diagram'. It creates a diagram for all your classes. To see members of the class click on the down arrow next to the class name.