Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

VS.NET CodeDOM-Based Custom Tool for String Resource Management

, 22 Jun 2004
A VS.NET custom tool, created with the help of CodeDOM and EnvDTE, used to facilitate management of resource strings via IntelliSense and error checking in VS.NET environment.
resourceclassgenerator.zip
ResourceClassGenerator
redist
ResourceClassGenerator.dll
ResourceClassGenerator.csproj.user
TestCSharp
App.ico
bin
Debug
de
en
Release
de
TestCSharp.resources.dll
en
TestCSharp.resources.dll
TestCSharp.exe
Resources
TestCSharp.csproj.user
TestVB
bin
de
TestVB.resources.dll
en
TestVB.resources.dll
TestVB.exe
Resources
TestVB.vbproj.user
resourceclassgenerator_10.zip
ResourceClassGenerator.dll
ResourceClassGenerator.csproj.user
App.ico
TestCSharp.resources.dll
TestCSharp.resources.dll
TestCSharp.exe
TestCSharp.csproj.user
TestVB.resources.dll
TestVB.resources.dll
TestVB.exe
TestVB.vbproj.user
'------------------------------------------------------------------------------
' <autogenerated>
'     This code was generated by a tool.
'     Runtime Version: 1.1.4322.573
'
'     Changes to this file may cause incorrect behavior and will be lost if 
'     the code is regenerated.
' </autogenerated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On

Imports System
Imports System.Reflection
Imports System.Resources


'-----------------------------------------------------------------------------
' <autogeneratedinfo>
'     This code was generated by:
'       ResourceClassGenerator custom tool for VS.NET
'
'     It contains classes defined from the contents of the resource file:
'       C:\Development\DotNet\Essential Tools\ResourceClassGenerator\TestVB\Resources\Strings.en.resx
'
'     Generated: Wednesday, June 23, 2004 10:22 AM
' </autogeneratedinfo>
'-----------------------------------------------------------------------------
Namespace Resources.Strings
    
    '<summary>
    'Provides access to an assembly's string resources
    '</summary>
    Class ResourceFormatter
        
        Private Shared _ResourceManager As System.Resources.ResourceManager
        
        '<summary>
        'ResourceManager property with lazy initialization
        '</summary>
        '<value>An instance of the ResourceManager class.</value>
        Private Shared ReadOnly Property ResourceManager As System.Resources.ResourceManager
            Get
                If (_ResourceManager Is Nothing) Then
                    _ResourceManager = New System.Resources.ResourceManager("TestVB.Strings", System.Reflection.Assembly.GetExecutingAssembly)
                End If
                Return _ResourceManager
            End Get
        End Property
        
        '<summary>
        'Loads an unformatted string
        '</summary>
        '<param name="resourceId">Identifier of string resource</param>
        '<returns>string</returns>
        Public Overloads Shared Function GetString(ByVal resourceId As String) As String
            Return ResourceFormatter.ResourceManager.GetString(resourceId)
        End Function
        
        '<summary>
        'Loads a formatted string
        '</summary>
        '<param name="resourceId">Identifier of string resource</param>
        '<param name="objects">Array of objects to be passed to string.Format</param>
        '<returns>string</returns>
        Public Overloads Shared Function GetString(ByVal resourceId As String, ByVal args() As Object) As String
            Dim format As String = ResourceFormatter.ResourceManager.GetString(resourceId)
            Return String.Format(format, args)
        End Function
    End Class
    
    '<summary>
    'Access to resource identifier Label1
    '</summary>
    Class Label1
        
        Public Shared Function GetString() As String
            Return ResourceFormatter.GetString("Label1")
        End Function
    End Class
    
    '<summary>
    'Access to resource identifier Label2
    '</summary>
    Class Label2
        
        Public Shared Function GetString(ByVal arg0 As Object, ByVal arg1 As Object) As String
            Return ResourceFormatter.GetString("Label2", New Object() {arg0, arg1})
        End Function
    End Class
    
    '<summary>
    'Access to resource identifier Label3
    '</summary>
    Class Label3
        
        Public Shared Function GetString() As String
            Return ResourceFormatter.GetString("Label3")
        End Function
    End Class
    
    '<summary>
    'Access to resource identifier Label4
    '</summary>
    Class Label4
        
        Public Shared Function GetString() As String
            Return ResourceFormatter.GetString("Label4")
        End Function
    End Class
    
    '<summary>
    'Access to resource identifier Label5
    '</summary>
    Class Label5
        
        Public Shared Function GetString() As String
            Return ResourceFormatter.GetString("Label5")
        End Function
    End Class
End Namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jasmin Muharemovic
Software Developer Mono Ltd
Croatia Croatia
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 23 Jun 2004
Article Copyright 2004 by Jasmin Muharemovic
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid