Exemple #1
0
 /// <summary>Creates a <see cref="T:System.Resources.ResourceManager" /> that looks up resources in satellite assemblies based on information from the specified <see cref="T:System.Type" />.</summary>
 /// <param name="resourceSource">A <see cref="T:System.Type" /> from which the <see cref="T:System.Resources.ResourceManager" /> derives all information for finding .resources files. </param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="resourceSource" /> parameter is null. </exception>
 public ResourceManager(Type resourceSource)
 {
     if (resourceSource == null)
     {
         throw new ArgumentNullException("resourceSource");
     }
     this.resourceSource  = resourceSource;
     this.BaseNameField   = resourceSource.Name;
     this.MainAssembly    = resourceSource.Assembly;
     this.ResourceSets    = ResourceManager.GetResourceSets(this.MainAssembly, this.BaseNameField);
     this.neutral_culture = ResourceManager.GetNeutralResourcesLanguage(this.MainAssembly);
 }
Exemple #2
0
 /// <summary>Initializes a new instance of the <see cref="T:System.Resources.ResourceManager" /> class that looks up resources contained in files with the specified root name using the given assembly.</summary>
 /// <param name="baseName">The root name of the resource file without its extension and along with any fully qualified namespace name. For example, the root name for the resource file named "MyApplication.MyResource.en-US.resources" is "MyApplication.MyResource".</param>
 /// <param name="assembly">The main assembly for the resources. </param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="baseName" /> or <paramref name="assembly" /> parameter is null. </exception>
 public ResourceManager(string baseName, Assembly assembly)
 {
     if (baseName == null)
     {
         throw new ArgumentNullException("baseName");
     }
     if (assembly == null)
     {
         throw new ArgumentNullException("assembly");
     }
     this.BaseNameField   = baseName;
     this.MainAssembly    = assembly;
     this.ResourceSets    = ResourceManager.GetResourceSets(this.MainAssembly, this.BaseNameField);
     this.neutral_culture = ResourceManager.GetNeutralResourcesLanguage(this.MainAssembly);
 }
Exemple #3
0
 private ResourceManager(string baseName, string resourceDir, Type usingResourceSet)
 {
     if (baseName == null)
     {
         throw new ArgumentNullException("baseName");
     }
     if (resourceDir == null)
     {
         throw new ArgumentNullException("resourceDir");
     }
     this.BaseNameField   = baseName;
     this.resourceDir     = resourceDir;
     this.resourceSetType = this.CheckResourceSetType(usingResourceSet, false);
     this.ResourceSets    = ResourceManager.GetResourceSets(this.MainAssembly, this.BaseNameField);
 }