Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / October 2005

Tip: Looking for answers? Try searching our database.

IVsFontAndColorDefaultsProvider & IVsFontAndColorDefaults .. how to do the registry entries??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred Heida - 07 Oct 2005 01:21 GMT
Hi All,

I'm implementation the IVsFontAndColorDefaultsProvider &
IVsFontAndColorDefaults for
my package (using C#)

i now need to create the registry entries for the Category / Package.. how
is this suppose to be
done?

Regards,

Fred
Matthew Etter - 07 Oct 2005 15:35 GMT
There is a blog posting on the DrEx blog that addresses the keys that need
to be created, in case you haven't already read it.
http://blogs.msdn.com/dr._ex/archive/2005/06/03/425099.aspx

So the question remains, how the heck do you actually make the registry
entries?

If you are using the MPF (Managed Package Framework) classes, there is a
class called Registration attribute.
(Microsoft.VisualStudio.Shell.RegistrationAttribute)

1) Derive your own attribute class from this attribute and implement
overrides of the Register and Unregister methods. The Register method is
where you write your values, Unregister is where you clean up after
yourself. Write your constructor so that it will take all the information
you need (like the category and service guids, etc)

using Microsoft.VisualStudio.Shell;
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited =
true)]
public class FontColorRegistrationAttribute : RegistrationAttribute
{ ....
public override void Register(RegistrationAttribute.RegistrationContext
context){...}
public override void Unregister(RegistrationAttribute.RegistrationContext
context){...}
}

The RegistrationContext argument is really handy. You call
context.CreateKey("FontsAndColors\\MyPackageName");
to create the appropriate subkey. The will correspond to creating a registry
key for you underneath the Visual Studio version hive.

2) Decorate your package class with this new attribute

[FontColorRegistration(..ctor params...)]
public class MyPackage : Microsoft.VisualStudio.Shell.Package

3) When the package registration tool runs, it will look for these
attributes, and invoke the Register method. That's it.

--Matthew

> Hi All,
>
[quoted text clipped - 9 lines]
>
> Fred
Fred Heida - 10 Oct 2005 23:59 GMT
Hi Matthew,

thx!

Cheers,

Fred

> There is a blog posting on the DrEx blog that addresses the keys that need
> to be created, in case you haven't already read it.
[quoted text clipped - 52 lines]
>>
>> Fred

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.