March 17, 2008

VS.NET, macro creating string const, and macro creating string resource entry

Filed under: .net,programming,robo coding,vs.net Himanshu @ 2:08 pm

Per me, macro is one of the most important feature for any text editor or software IDE. And hence, it is very import for VS.NET user to understand and then use macros available in VS.NET. VS.NET macros are very powerfully tool and they help in lot more different ways.

I have created two macros that are very common in their need. While programming, we need to create string const on regular bases. It becomes inconvenient to go to top of the class while writing a method body for same class and create constant. Macro in library attached with this post becomes handy at that time.

Same use case hold very much true for creating string resources while writing method body. And it becomes really very easy if string resource can be created while writing method body.

For those who thinks like me (or want to 🙂 ), I have attached two macros with this post. Macro works for VS.NET 2005, haven't tested in any other version. But should work fine in VS.NET 2003 or VS.NET 2008

1 Comment

  1. Thanks for the resource string macro – it would have taken me ages to figure this out by myself.

    The added resource wasn’t saved in my file at first. I had to add this line:

    resxFileWriter.Close()

    and remove (or comment) these:
    ” resourceFileProjectItem.Open()
    ” resourceFileProjectItem.Save()

    before it worked.

    Comment by happysad — February 23, 2009 @ 1:41 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress