Is it possible to link Code Maps in VS Enterprise 2017? - c#

I am trying out the Code Map feature in VS 2017 Enterprise. However the maps get cluttered quickly. One can use the "New Graph from Selection" to create a new graph and then drill down further. However there seems no way to link the parent map to the child map, so navigating from one to another becomes very tricky. I would have expected to be able to put in a file link of some sort.
Any thoughts on this please?

It seems that one cannot do it in the GUI, one has to add a "reference" attribute to the Node element in the DGML file
<Node Id="#29" Category="CodeSchema_Method" Bounds="629.838307291667,-192.520041836548,154.936666666667,25.96" CodeSchemaProperty_IsPrivate="True" DelayedCrossGroupLinksState="Fetched" Label="MyMethod" UseManualLocation="True" Reference = "Graph1_1_1_1.dgml"/>
You then get a "go to reference" menu option for the relevant node.
Hope this is helpful to someone.

Related

Change find all / search all result interface in Visual Studio 2019 community

i dont like the new interface of my search all, it suddenly change when i reinstall my visual studio
here is my search all result interface
the result suppose like this
Do you guys know how to change the result interface ?
It sounds like you are using 2 different types of search.
The first capture you provide is from Find and replace feature, that cand be raised with shortcut Ctlr + F, and when you select option "Find all". It returns a lsit fo files that match the text you are searching for. You may check Microsoft documentacion for Find and replace
The second capture represent the usage of Find references in your code, that provides a way to find where particular code elements are referenced throughout your codebase. You can find more information in Microsoft documentacion for Find references.
If you want to make use of Find references feature, you should use shortcut Shift + F12 or simply you can make right click over any object/class/element in your code, and select option Find all references.
Capture: Find all references using right click and contextual menu
Remember that this would not work with a simple piece of text, you must find references of an existant element, like a model, a class, a variable, etc.
Hope this info could be useful.
[EDIT]
Maybe I could misunderstand your question. If you refer to the theme (backgroud anf font color mainly) of the interface, you could set Light theme option, through main menu, selecting Tools menu, and then Options. once there, enter section General, under Environment option, and select Light option in dropdownlist associated with Color theme option.
Check this link (made for VS CE 2017, but work as well) to see captures of the process:
https://ourcodeworld.com/articles/read/869/how-to-change-to-a-dark-theme-in-visual-studio-community-2017
[EDIT FOR COMMENT]
I've checked it with VS 2019. As you said, default view for Find all feature looks like references result view. If you want to keep the "classic" list view, you can simply click on ListView button, at the right top, on the bar that appears over your result section, as you can see in following capture.

Updating the namespace automatically in Visual Studio 2015/ C#

I am doing some clean up/ restructuring on my code (C#) were I move my classes in the tree structure. I am looking for a way to update all namespaces to the default ones (like projectname.rootFolder.ChildFolder).
I know that there are some ways to do it one by one like in this old post but I am looking for a clean simple update way. I wish there was something like "right clicking on the folder and clicking on update namespace!" but there is not.
Anyone knows any add-on/ easy way to do it?
Resharper is a tool to work on legacy code. Try to use this tool.
Right click on the folder> go to refactor and then select adjust Namespaces

How do you get custom intellisense comments to appear when using a custom DLL in Visual Studio C#?

I have been wondering how to setup intellisense comments for Visual Studio (minimum version 2013) and have been having trouble. Using XML comments are only useful for generating the separate file for documentation.
What I want is to be able to put descriptions on functions/methods that show up when I hover over them in a project I am working that includes the DLL that should have these descriptions already set. This is something trivial to be honest but it would be really nice to have this functionality. But every thing I try seems to end with no comments being shown in the project when I hover over these functions/methods.
To restate my question, what needs to be done to allow for my descriptions of functions/methods to appear when I hover over them when they are used in a separate project/solution?
Okay. I got it to work. I just checked the XML documentation file box in Project Properties -> Build Tab. I also needed to include it as Alexei Levenkov helped me out with in the comments. Doing both of those things allow them to show up.

Sparx Enterprise Architect Version 10 - Create Class Diagram from Source

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

Doing ILDASM Tool using winforms

I have a tutorial to implement "My Own ILDASM" , may I know what approach i can use.
I have visual studio 2010 installed on my computer , i added MenuStrip and OpenFIleDialog.
My Questoins
1) I need to add a treeview control to display type members hierarchy in a tree
any direction will be enough
after selecting a dll from winform , how can i show that dll info in the tree view.
Any info will be appreciated.
First, bone up on reflection.
Then, build up the namespaces and have those as top level tree view items. Next get all the Types. For example: Assembly.GetTypes.
From here you should be getting the hang of it. For each type, get the methods, properies, fields etc and make the subnodes.

Categories

Resources