How to write a Visual Studio Addin to manage comment annotations - c#

I am new to Visual Studio addin development and want to create a small prototype of an addin for a course at the university. I already looked at a couple of tutorials and the VS SDK. Before I dig further into this topic, I want to ask if it is possible to develop what I want:
My goal (for the prototype is) to receive all annotations in the sources commentary annotations (i.e. TODO, HACK, FIXME, etc.) in my plugin and then to run some analytics.
So, is it (theoretically and using the existing API) possible to get a list of those commentary annotations? If yes, any link to a tutorial, blogpost or code sample would be very much appreciated!
Thank you!

You can use the SVsTaskList service to access standard VS annotations. See also the following EnumTaskItems sample.

Related

How to create basic IFC File in C#

As per Wiki, The Industry Foundation Classes (IFC) data model is intended to describe architectural, building and construction industry data.
The Industry Foundation Classes (IFC) data model is a neutral and open specification that is not controlled by a single vendor or group of vendors. It is an object oriented file format with a data model developed by buildingSMART (International Alliance for Interoperability, IAI) to facilitate interoperability in the building industry, and is a commonly used format for Building Information Modeling (BIM).
For example One could be developing virtual building model in Revit, then send it to interior team who use ArchiCAD. It might also be sent to engineers who use Tekla. Before the IFC standard file type this would have been a nightmare. As Revit, ArchiCAD, Tekla can talk to each other, but not easily!!!
IFC aims to solve this problem, so that it won't matter so much. IFC file is unified format which can be understood by other CAD Softwares as well.
My Organisation works on one of the CAD Software and they want to export there Models in IFC so that it can be open and viewed in Other software's as well like Revit, ArchiCAD, Tekla.
So Our use case is, we need to create a IFC file of such a model.
So as per this Post, I am planning to use xBim. This link
I am using xBim Library to Create IFC File in C#. As per xBim documentation and Sample Code, I found that, How to create a Simple wall.
Now I want to create a basic Xbim.Ifc4.HvacDomain.IfcPump.
Can someone help me how to create one Xbim.Ifc4.HvacDomain.IfcPump in IFC using xBim C#?
I am new in CAD development and hence I am finding difficulties to understand the IFC. Please do the needful.
I hope this much information will be helpful,enough and clear.
Thanks in advance!!!
Without an example of code of what have you tried is difficult to help, but you can find resources in the API of XBim. With the examples of how to setup a wall in the document and the API documentation you should have clues to how to start your program, once you have some code, you can clarify the question so the community can help you more efficiently.
About how the IFC works and is written, you can find all you need to know here if you use a different version check the this website, in the IFC documentation the pump you are looking for is here.
I hope this resources are useful for you task.

Access IVsFontAndColorDefaults to read complete existing VS theme information

I am new at working on a Visual Studio extension. I would like to access the complete font and color information for the current theme using C# I want to access this as a AllColorableItemInfo structure as this structure includes more information (e.g. flags and the localized name) for the each item. I believe that I need to use IVsFontAndColorDefaults interface to do this but I don't know how to get this. This is probably easy but I cannot figure out how to do it. I very much appreciate any help.
I think that you are probably on the wrong track IVsFontAndColorDefaults. The documentation seems to indicate, that this is an interface a Visual Studio Package would implement, rather than use itself.
I have some code which accesses the colors used in Visual Studio. It is based almost exactly on this article by Carlos Quintero. The code is in VB.NET, but it would be easy to port to C#.
Alternatively, you might find what you are looking for in the interface IVsFontAndColorStorage.
You can get that interface with code like
IVsFontAndColorStorage fontAndColorStorage =
GetService(typeof(SVsFontAndColorStorage)) as IVsFontAndColorStorage;
which I took from this posting this posting on Stack Overflow

How to programmatically create custom comment tokens

I am writing a small Visual Studio addin to let the user use more features of the comment tokens (TODO, HACK, etc.). For this I want to extend Visual Studio with new commands (such as TODISCUSS, TODELETE, FIXME, TESTME, etc.). I'd like to do this programmatically when my addin starts.
I already found out how to do this manually: http://msdn.microsoft.com/en-us/library/ekwz6akh%28v=vs.80%29.aspx
Does anyone have an idea how this could be done via the API?
Any ideas or suggestions would be appreciated!
Edit :
See this MSDN Link perhaps digging around in TaskList will get you somewhere.
Original Post :
It's not very clear (to me :) what exactly you want to do. Is it: find, edit, or refactor the tokens and then do something else with the sources? I can suggest this article on Code Project (NRefactory).
Using NRefactory you can do anything and everything with the source files including locating the tokens you want and doing stuff with them. You will also know the files you found them in, line numbers etc.
Perhaps you will be able to use Nrefactory to do all the heavy lifting as far as sources are concerned.

Automatically convert a MindMap to another app (e.g. MS Project)

Here is the situation:
We ran a brainstorming session to find all the tasks we will have to achieve for our project
Now, I want to create a Gantt Planning (for instance) with all these tasks
We already built a MindMap with Xmind (I sometimes use Freemind too, or I could also export the Xmind to a Freemind format).
I would like to create a Gantt Planning in Microsoft Project (this is what we mainly use here).
My questions are:
Has anyone of you ever tried to automate the creation of a Gantt from the MindMap (using each level of the MindMap as Title and each leaf as Tasks)?
Would it be possible with VBA? Or C#? I didn't find much API to Xmind of Freemind, did I miss something?
If you can convert your mind map to Freemind, there is some documentation on the Freemind site which provides a couple of approaches to reformatting the Freemind file as an XML file which MS Project can read.
I maintain MPXJ, a library which can be used to read and write file formats which MS Project works with. I felt sure that someone had already written an add-on for Freemind which allowed you to export mind maps as a project plan using MPXJ... however I can't find a reference to it any more! If you don't mind a bit of coding (in Java, or any of the .Net languages) it wouldn't be too hard to achieve what you want using MPXJ.
Jon
We're doing exactly that with STOIC.

Visual Studio 2008 and C#

I'm an IT Professional with a background with developing ASP/VBscript/SQL web applications. I want to take some training and get up to speed with Visual Studio 2008 and C# so that I can take over a project at work and make updates/bug fixes in house rather than calling in a third party.
The web application I'll be working on was developed in Visual Studio 2005 with a mix of C# code and some Ajax.
When I load the source code into Visual Studio 2008 I received a warning that the Source Control Plugin wasn't installed. It's looking for SourceSafe which I don't have. Is this necessary to use?
I'm starting a training course in February called Introduction to Visual Studio C# 2008. Well this be adequate to get me going in the right direction to be able to update, fix, and make minor changes to our web application? This is a big opportunity for me and I don't want to blow it.
Thanks!
SourceSafe is a Software Configuration Management tool from Microsoft, and is not required. I WOULD recommend using some form of SCM, but flavor is a matter of preference.
If the pop-ups are annoying to you and you would like to disable them, then removing the SourceSafe bindings from the project should stop them.
From http://weblogs.asp.net/bkcarroll/archive/2004/03/08/86059.aspx :
Solution:
1 - Go to the folder containing the solution files and delete the following:
mssccprj.scc
MyProject.vssscc
vssver.scc
2 - Open MyProject.sln in your favorite text editor and remove the following section:
GlobalSection(SourceCodeControl) = preSolution
...
EndGlobalSection
3 - Go to the folder containing the project files and delete the following:
MyProject.vbproj.vspscc
mssccprj.scc
vssver.scc
4 - Open MyProject.vbproj in your text editor and remove the following lines:
SccProjectName = "SAK"
SccLocalPath = "SAK"
SccAuxPath = "SAK"
SccProvider = "SAK"
Now you can open the solution/project with no source control errors.
As far as the class goes, if you're already familiar with ASP/VBScript, you can probably pick up a C# class and figure out the rest. If not, I would suggest going for an ASP focused class that utilizes a C# back-end.
I would expect that a course named "Introduction to Visual Studio C# 2008" would probably not cover Ajax technologies, so you might want to look for some additional resources on that topic. (It might not even cover ASP.NET in significant depth, so I'd advise checking the syllabus, and if the ASP.NET coverage is weak then prepare for some additional learning on that topic as well.)
Re the Source Safe plug-in: you will need this if you want to work on the code base (so you can check in and out of the existing VSS repository). You will not need it just to browse the code.
Well James that is up to you. I am not familer with the course but if you apply yourself and pay attention I'm sure you can achive your goal. Do not be afraid to move beyond just course work to learn new things. There is a lot of information about Visual Studio on the internet.
SourceSafe is not required to use Visual Studio.
Learning the basics of VS will definitely allow you to update and fix your web apps. VS allows you to work with all the technologies you mentioned all in one environment. Although ASP/VBScript are "legacy" at this point, there is still support for them in the VS environment.
James I'd suggest that you look at the free resources (video and textual) available to you on ASP.NET. I would presume that once you've read a few tutorials and watched some videos + taken your training course you should be able to maintain the code base. Add in the fact that sites like StackOverflow have a large .NET community and there are always people willing to help.
Good luck

Categories