VisualStudio IVSFontAndColor - c#

Working on an extension that deals with text editor colors. I found the VsFontAndColorStorage interface, but don't fully understand how to use it.
Is there an example somewhere, or some example program that I can look at to understand how to store and retrieve colors?

Have a look at this there it shows to write your new fonts to the registry and read it using the
IVsFontAndColorStorage interface

Related

How to write C# code to add a new Range or edit in AGauge?

I am writing a C# code for school to display simulated values using AGauge.
I wanted to write as a code to add new range instead of using editor.
On the attached link, it is mentioned that it is possible using code.
https://www.codeproject.com/Articles/448721/AGauge-WinForms-Gauge-Control
Can you please explain how can this be done as there is no code example on this weblink?
If you can do this with the editor, you can find the corresponding code in the auto-generated file named xx.Designer.cs.
Originally everyone has to write code in a primitive editor like Notepad, but later Visual Studio (and other IDE) provides us with a nice designer and also translates what we input in the designer to the the actual code, and use the actual code in the compilation.

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

Specify language in Octokit.net for Gist

I am attempting to create a new NewGist using Octokit.net however I can't seem to find a way to specify a language (Text, C#, C++, Java, etc) so whenever it is created it simply creates it as Text.
Am I missing something or is there no functionality with this API to specify it? Thanks!
Based on a test that I just carried out, it looks as though the language for a file contained with a gist is being inferred from the extension of the filename.
For example, I just created a gist using octokit which contained a filename of install.ps1. On checking the created gist, the language dropdown was already pre-selected with PowerShell.

How to syntax highlight using scintilla?

How can I syntax highlight using the scintilla. I have no idea how to use it. I need a code sample that loads scintilla, puts a String[], and runs it in a richtextbox.
You might find your answer here.
alternatively apparently some file can't be found it seems like an installation issue.
might find more here

display icon with respective file

Ok this is something new to me....
I have a gridview control which is displaying the files and directory names in one column.
Now i want to display the file icon of that particular file in the other column...
eg test.txt will have a different icon form image1.jpg and here.xsl
i have found two examples but don't kno if they will work or not....
http://www.codeproject.com/KB/custom-controls/AssociatedIconsImage.aspx
or
http://forums.asp.net/t/90921.aspx
how to incorporate this with my gridview..?
thanks
I found a source that should be useful for you (and with a simple google query btw.): Getting Associated Icons Using C#
.
As far as I know, there's no other way than using the shell32 library via interop, as used in the given example.
I'm not sure if there is a managed way to this... there very well could be, but the unmanaged way to get this would be to use PInvoke to call SHGetFileInfo. There is sample code on PInvoke.Net which should get you most of the way there.

Categories