void Load(string rpLanguageName) { var rMainResourceFile = Path.Combine(StringResourceDirectory.FullName, rpLanguageName, "Main.xml"); if (!File.Exists(rMainResourceFile)) throw new Exception(); Main = new StringResourcesItems(XDocument.Load(rMainResourceFile).Root.Descendants("String").ToDictionary(r => r.Attribute("Key").Value, r => r.Value)); IsLoaded = true; }
void LoadMainResourceCore(string rpLanguageName) { var rAssembly = Assembly.GetExecutingAssembly(); using (var rStream = rAssembly.GetManifestResourceStream($"Sakuno.KanColle.Amatsukaze.Resources.Strings.{Preference.Current.Language}.xml")) using (var rReader = new StreamReader(rStream)) { Main = new StringResourcesItems(XDocument.Load(rReader).Root.Descendants("String").ToDictionary(r => r.Attribute("Key").Value, r => r.Value)); IsLoaded = true; } }