|
|
|
@ -24,18 +24,18 @@ namespace ICSharpCode.Core
@@ -24,18 +24,18 @@ namespace ICSharpCode.Core
|
|
|
|
|
/// This Class contains two ResourceManagers, which handle string and image resources
|
|
|
|
|
/// for the application. It do handle localization strings on this level.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class ResourceService |
|
|
|
|
public static class ResourceService |
|
|
|
|
{ |
|
|
|
|
readonly static string uiLanguageProperty = "CoreProperties.UILanguage"; |
|
|
|
|
|
|
|
|
|
readonly static string stringResources = "StringResources"; |
|
|
|
|
readonly static string imageResources = "BitmapResources"; |
|
|
|
|
|
|
|
|
|
static string resourceDirctory; |
|
|
|
|
static string resourceDirectory; |
|
|
|
|
|
|
|
|
|
static ResourceService() |
|
|
|
|
{ |
|
|
|
|
resourceDirctory = FileUtility.Combine(PropertyService.DataDirectory, "resources"); |
|
|
|
|
resourceDirectory = FileUtility.Combine(PropertyService.DataDirectory, "resources"); |
|
|
|
|
LoadLanguageResources(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -111,25 +111,16 @@ namespace ICSharpCode.Core
@@ -111,25 +111,16 @@ namespace ICSharpCode.Core
|
|
|
|
|
|
|
|
|
|
static void InitializeService() |
|
|
|
|
{ |
|
|
|
|
RegisterAssembly(Assembly.GetEntryAssembly()); |
|
|
|
|
Assembly assembly = Assembly.GetEntryAssembly(); |
|
|
|
|
if (assembly != null) { |
|
|
|
|
RegisterAssembly(assembly); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PropertyService.PropertyChanged += new PropertyChangedEventHandler(ChangeProperty); |
|
|
|
|
|
|
|
|
|
LoadLanguageResources(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// core service : Can't use Initialize, because all other stuff needs this service before initialize is called.
|
|
|
|
|
ResourceService() |
|
|
|
|
{ |
|
|
|
|
// if (System.Configuration.ConfigurationSettings.AppSettings["UserStrings"] != null) {
|
|
|
|
|
// userStrings = Load(resourceDirctory + Path.DirectorySeparatorChar + System.Configuration.ConfigurationSettings.AppSettings["UserStrings"]);
|
|
|
|
|
// }
|
|
|
|
|
// if (System.Configuration.ConfigurationSettings.AppSettings["UserIcons"] != null) {
|
|
|
|
|
// userIcons = Load(resourceDirctory + Path.DirectorySeparatorChar + System.Configuration.ConfigurationSettings.AppSettings["UserIcons"]);
|
|
|
|
|
// }
|
|
|
|
|
InitializeService(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The LoadFont routines provide a safe way to load fonts.
|
|
|
|
|
/// </summary>
|
|
|
|
@ -210,7 +201,7 @@ namespace ICSharpCode.Core
@@ -210,7 +201,7 @@ namespace ICSharpCode.Core
|
|
|
|
|
|
|
|
|
|
static Hashtable Load(string name, string language) |
|
|
|
|
{ |
|
|
|
|
return Load(resourceDirctory + Path.DirectorySeparatorChar + name + "." + language + ".resources"); |
|
|
|
|
return Load(resourceDirectory + Path.DirectorySeparatorChar + name + "." + language + ".resources"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|