Rbm Visual Studio Eye Friendly DarkTheme

April 23, 2009 · Posted in Visual Studio · 2 Comments 

Rbm-DarkTheme.zip

Introduction

Recently I have passed through a very cool Theme For Visual Studio 2008 it’s called TaznimSaqib-DarkTheme I found it a very nice theme indeed and very comforting for my eyes so since I use Both Visual Studio 2008 and Visual Studio 2005 I decided to make a similar one for Visual Studio 2005. you could find a screenshot to the theme below

screenshotcode

Setting the Theme in Visual Studio

For setting the theme click on tools -> Import and Export

Then select Import Selected Environment Settings, In the next page select save my current settings and press next. Then browser for the settings file that you could download from above. Then select next then finish.

Hope you enjoy the theme and you find it cool to use. Share your thoughts :)

Building a Custom Tool Generator For Visual Studio

April 7, 2009 · Posted in .NET, C#, Visual Studio · 3 Comments 

CustomToolForVisualStudio.zip
BaseCodeGeneratorWithSite.dll

Introduction

Sometimes you need to generate your own code for some XML Files in your Visual Studio Project or replace the Resource File Generated Code of the Visual Studio with one of your the reason you may want to do this is that you may want to work with a custom resource provider while the generated code in .NET makes the static properties work only with the resource file.

Using the Code

First to do that you need to inherit from the BaseCodeGeneratorWithSite then generate a GUID for it from Tools -> Create Guid -> Then Select the Registry format and copy the guid to mark your class with this GUID Will let the Visual Studio later on know the class it should call. Then place a GUID and a ComVisible attributes on your class.

    [Guid("A2A52B1B-48A1-45af-A30E-8D86E4DE0D79")]
    [ComVisible(true)]
    public class CustomToolGenerator : BaseCodeGeneratorWithSite

Then Override the GenerateCode Method

   protected override byte[] GenerateCode(string inputFileName, string inputFileContent)
   {
        string code = "Generated Code Should Be Placed Here";
        return System.Text.Encoding.ASCII.GetBytes(code);
   }

If you want the namespace that the File is comming from it’s available in the “FileNameSpace” property of the BaseCodeGeneratorWithSite class.

In the AssemblyInfo.cs Class make the Assembly Com Visible by placing the following code in it

[assembly: ComVisible(true)]

Generate a Strong Name Key for your project using the Visual Studio Command Prompt sn -k CustomToolForVisualStudio.snk and bind your project to it- Right Click on the project then select Properties then Select Signing and choose Sign the assembly property and select the Strong Name Key you have just generated

For Registering the Generator in the Visual Studio you need to place a reference to it in the Registry
Visual Studio 2005
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Generators\
Visual Studio 2008
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Generators\
These are the sub keys for different languages they are named with their GUID you will go inside them
{164B10B9-B200-11D0-8C61-00A0C91E29D5}: Visual Basic
{E6FDF8B0-F3D1-11D4-8576-0002A516ECE8}: J#
{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}: C#

Then Create a key with the name of your class and inside it place the following
(Default): String: CustomToolGenerator (name of the custom tool)
CLSID: String: {A2A52B1B-48A1-45af-A30E-8D86E4DE0D79} (Generated Guid)
GeneratesDesignTimeSource: DWORD: 1

Now Register you Assembly using the resgen command in the Visual Studio Command Prompt

regasm /codebase CustomToolForVisualStudio.dll

Using the Custom Tool in Visual Studio

Right Click on a Resource File or XML File and click properties then place in the CustomTool property the value “CustomToolGenerator

The Custom Tool will now generate the code based on the code given in the “GenerateCode
” Method.

Hope you like it :) Please share your thoughts

























































download movies

ñêà÷àòü ôèëüìû