C++ C++ C# C# ASP.NET Security ASP.NET Security ASM ASM Скачать Скачать Поиск Поиск Хостинг Хостинг  
  Программа для работы с LPT портом...
Язык: .NET — ©Alexey...
  "ASP.NET Atlas" – AJAX в исполнении Micro...
Язык: .NET — ©legigor@mail.ru...
  "Невытесняющая" Многопоточность...
Язык: C/C++ — ©...
  Update World C++: Сборник GPL QT исходников
  Весь сайт целиком можно загрузить по ссылкам из раздела Скачать
Дебетовая карта Home Credit [CPS] RU

 VS.NET add-in - search and jump to functions in current source file / VS.NET Addins / C#

Sample Image - GotoFunction.png

Introduction

This article is not so much an introduction to writing add-ins as it is just simply sharing a utility I found very useful for Visual Studio .NET. I primarily use VS.NET / C++ for development, however all our client applications are developed in Delphi 7.0, and I find the GExperts IDE enhancement suite for Delphi very good. Specifically, the ability to go to a function within the current source file. When you invoke the add-in, the above search dialog prompts you to enter a search string. As you type more characters, the list filters all the matches - which is a substring search. So, from the example list above, typing mes would reduce the list to PreProcessMessage and SendMessage.

If there is enough requests, I will fully document the program in this article as a true introduction to VS.NET add-ins.

Don't let the very basic dialog fool you. If you work in source files with a number of functions / members, you will find this add-in quite a time saver when jumping between functions.

This add-in will work with C++, VB.NET and C#. I don't see why it also wouldn't work with Visual J#.

Using the code

I have provided the full source code and an MSI installer, so you can immediately get running. To get the intended benefit from this utility, I recommend you assign it a shortcut (I use CTRL+G, to match the Delphi version). As you type in the search box, the function list will continually reduce. You can use the PGUP/DOWN and UP/DOWN keys without leaving the edit box. Hitting ENTER will centre the function in your editor window.

Points of Interest

The main point of interest is the frmGotoFunction.cs file, which contains all the guts of the app.

It uses the FileCodeModel object to extract out all the functions from the current source file, however when actually moving the edit point, I had to check if the source file was C++, as the definition and declaration can be separated into a header and source file. If the language is C++, I obtain an interface to the VCCodeElemet object and use the StartPointOf method to either get a TextPoint to the definition if the file extension is ".H" or otherwise to the declaration. This is currently not very robust, so I will investigate further, but currently works for me.

I won't list functions declared in a templated file like STL <list> or one of the ATL files. I haven't yet checked to see why.

History

Version 1.0 - Initial public release.




Дебетовая карта Home Credit [CPS] RU