C# 클래스 Westwind.Globalization.StronglyTypedResources

Class that handles generating strongly typed resources for global Web resource files. This feature is not supported in ASP.NET stock projects and doesn't support custom resource providers in WAP.
파일 보기 프로젝트 열기: RickStrahl/Westwind.Globalization

공개 메소드들

메소드 설명
CreateClassFromAllDatabaseResources ( string Namespace, string FileName, IEnumerable resourceSets = null ) : string

Creates strongly typed classes from all global resources in the current application from the active DbResourceManager. One class is created which contains each of the resource classes. Classnames are not necessarily named with Uses the default DbResourceConfiguration.Current settings for connecting to the database.

CreateClassFromDatabaseResource ( string ResourceSetName, string Namespace, string Classname, string FileName ) : string

Creates a strongly typed resource class for a ResoureSet from the DbResourceManager. Note: Uses the default ResourceProvider settings as set in the DbResourceConfiguration.Current property for opening the database and otherwise setting values.

CreateClassFromFromAllGlobalResXResources ( string Namespace, string FileName ) : string

Creates a class containing strongly typed resources of all resource keys in all global resource ResX files. A single class file with multiple classes is created. The extension of the output file determines whether VB or CS is generated

CreateClassFromResXResource ( string ResXFile, string Namespace, string Classname, string FileName ) : string

Creates an ASP.NET compatible strongly typed resource from a ResX file in ASP.NET. The class generated works only for Global Resources by calling GetGlobalResourceObject. This routine parses the raw ResX files since you can't easily get access to the active ResourceManager in an ASP.NET application since the assembly is dynamically named and not easily accessible.

CreateClassFromResourceSet ( ResourceSet resourceSet, string nameSpace, string classname, string fileName ) : string
CreateGlobalResxResourceDesignerFiles ( string Namespace, CodeGenerationLanguage lang ) : void

Creates a strongly typed resource class that uses the ASP.NET Resource Manager rather than using Resx .NET resources which basically results in duplicated resource sets loaded. Overwrites the generated.

CreateResxDesignerClassFromResourceSet ( string resourceSetName, string nameSpace, string classname, string fileName ) : string

Creates a strongly typed resource from a ResourceSet object. The ResourceSet passed should always be the invariant resourceset that contains all the ResourceIds. Creates strongly typed keys for each of the keys/values.

CreateResxDesignerClassFromResxFile ( string resxFile, string resourceSetName, string namespaceName, bool vb = false ) : void

Creates a StronglyTyped class from a REsx file. Can be used after a Resx fi

CreateResxDesignerClassesFromAllDatabaseResources ( string ns, string outputPath, IEnumerable resourceSets = null ) : string

Creates strongly typed classes from all global resources in the current application from the active DbResourceManager. One class is created which contains each of the resource classes. Classnames are not necessarily named with Uses the default DbResourceConfiguration.Current settings for connecting to the database.

SafeVarName ( string phrase ) : string
StronglyTypedResources ( string WebPhysicalPath ) : System

비공개 메소드들

메소드 설명
CreateClassHeader ( string Classname, string nameSpace, bool IsVb, StringBuilder sbClass ) : void

Creates the class header for a page

CreateNameSpaceWrapper ( string Namespace, bool IsVb, string Class ) : string

Wraps the body of a class (or multiple classes) into a namespace and adds teh appropriate using/imports statements. If no namespace is passed the using/imports are still added, but no namespace is assigned

CreateResxDesignerClassHeader ( string Classname, string nameSpace, bool IsVb, StringBuilder sbClass ) : void

Creates the class header for a page

CreateResxDesignerNameSpaceWrapper ( string Namespace, bool IsVb, string Class ) : string

Wraps the body of a class (or multiple classes) into a namespace and adds teh appropriate using/imports statements. If no namespace is passed the using/imports are still added, but no namespace is assigned

IsFileVb ( string FileName ) : bool

Checks to see if the file extension is .vb and if so returns true

메소드 상세

CreateClassFromAllDatabaseResources() 공개 메소드

Creates strongly typed classes from all global resources in the current application from the active DbResourceManager. One class is created which contains each of the resource classes. Classnames are not necessarily named with Uses the default DbResourceConfiguration.Current settings for connecting to the database.
public CreateClassFromAllDatabaseResources ( string Namespace, string FileName, IEnumerable resourceSets = null ) : string
Namespace string Optional namespace for the generated file
FileName string Output class file. .cs or .vb determines code language
resourceSets IEnumerable
리턴 string

CreateClassFromDatabaseResource() 공개 메소드

Creates a strongly typed resource class for a ResoureSet from the DbResourceManager. Note: Uses the default ResourceProvider settings as set in the DbResourceConfiguration.Current property for opening the database and otherwise setting values.
public CreateClassFromDatabaseResource ( string ResourceSetName, string Namespace, string Classname, string FileName ) : string
ResourceSetName string The name of the resource set. Should be a GLOBAL resource
Namespace string The namespace for the generated class. Null or string.Empty to not generate a namespace
Classname string Name of the class to be generated
FileName string Output filename for the CSharp class. If null no file is generated and only the class is returned
리턴 string

CreateClassFromFromAllGlobalResXResources() 공개 메소드

Creates a class containing strongly typed resources of all resource keys in all global resource ResX files. A single class file with multiple classes is created. The extension of the output file determines whether VB or CS is generated
public CreateClassFromFromAllGlobalResXResources ( string Namespace, string FileName ) : string
Namespace string
FileName string Output file name for the generated class. .cs and .vb generate appropriate languages
리턴 string

CreateClassFromResXResource() 공개 메소드

Creates an ASP.NET compatible strongly typed resource from a ResX file in ASP.NET. The class generated works only for Global Resources by calling GetGlobalResourceObject. This routine parses the raw ResX files since you can't easily get access to the active ResourceManager in an ASP.NET application since the assembly is dynamically named and not easily accessible.
public CreateClassFromResXResource ( string ResXFile, string Namespace, string Classname, string FileName ) : string
ResXFile string
Namespace string
Classname string
FileName string Output filename for the CSharp class. If null no file is generated and only the class is returned
리턴 string

CreateClassFromResourceSet() 공개 메소드

public CreateClassFromResourceSet ( ResourceSet resourceSet, string nameSpace, string classname, string fileName ) : string
resourceSet System.Resources.ResourceSet
nameSpace string
classname string
fileName string
리턴 string

CreateGlobalResxResourceDesignerFiles() 공개 메소드

Creates a strongly typed resource class that uses the ASP.NET Resource Manager rather than using Resx .NET resources which basically results in duplicated resource sets loaded. Overwrites the generated.
public CreateGlobalResxResourceDesignerFiles ( string Namespace, CodeGenerationLanguage lang ) : void
Namespace string
lang CodeGenerationLanguage
리턴 void

CreateResxDesignerClassFromResourceSet() 공개 메소드

Creates a strongly typed resource from a ResourceSet object. The ResourceSet passed should always be the invariant resourceset that contains all the ResourceIds. Creates strongly typed keys for each of the keys/values.
public CreateResxDesignerClassFromResourceSet ( string resourceSetName, string nameSpace, string classname, string fileName ) : string
resourceSetName string
nameSpace string
classname string Name of the class to generate. Pass null to use the ResourceSet name
fileName string Output filename for the CSharp class. If null no file is generated and only the class is returned
리턴 string

CreateResxDesignerClassFromResxFile() 공개 메소드

Creates a StronglyTyped class from a REsx file. Can be used after a Resx fi
public CreateResxDesignerClassFromResxFile ( string resxFile, string resourceSetName, string namespaceName, bool vb = false ) : void
resxFile string
resourceSetName string
namespaceName string
vb bool
리턴 void

CreateResxDesignerClassesFromAllDatabaseResources() 공개 메소드

Creates strongly typed classes from all global resources in the current application from the active DbResourceManager. One class is created which contains each of the resource classes. Classnames are not necessarily named with Uses the default DbResourceConfiguration.Current settings for connecting to the database.
public CreateResxDesignerClassesFromAllDatabaseResources ( string ns, string outputPath, IEnumerable resourceSets = null ) : string
ns string Optional namespace for the generated file
outputPath string
resourceSets IEnumerable
리턴 string

SafeVarName() 공개 정적인 메소드

public static SafeVarName ( string phrase ) : string
phrase string
리턴 string

StronglyTypedResources() 공개 메소드

public StronglyTypedResources ( string WebPhysicalPath ) : System
WebPhysicalPath string
리턴 System