1 //-------------------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // Description: String Loader class, loading strings from StringTable Resource.
4 //-------------------------------------------------------------------------------
8 using System
.Resources
;
9 using System
.Globalization
;
11 namespace BamlLocalization
13 internal class StringLoader
15 public static string Get( string id
, params object[] args
)
17 string message
= _resourceManager
.GetString(id
);
20 // Apply arguments to formatted string (if applicable)
21 if (args
!= null && args
.Length
> 0)
23 message
= String
.Format(CultureInfo
.CurrentCulture
, message
, args
);
28 // Get exception string resources for current locale
29 private static ResourceManager _resourceManager
= new ResourceManager("Resources.StringTable", typeof(StringLoader
).Assembly
);
30 }//endof class StringLoader