void LoadMainResourceCore(string rpLanguageName)
        {
            var rAssembly = Assembly.GetExecutingAssembly();

            using (var rStream = rAssembly.GetManifestResourceStream($"Sakuno.KanColle.Amatsukaze.Resources.Strings.{Preference.Instance.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;
                }
        }
Ejemplo n.º 2
0
        void LoadMainResourceCore(string rpLanguageName)
        {
            var rMainResourceFile = Path.Combine(r_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;
        }
Ejemplo n.º 3
0
        void LoadMainResourceCore(string rpLanguageName)
        {
            var rAssembly = Assembly.GetExecutingAssembly();

            using (var rStream = rAssembly.GetManifestResourceStream($"Sakuno.KanColle.Amatsukaze.Resources.Strings.{Preference.Instance.Language}.xml"))
                using (var rReader = new StreamReader(rStream))
                {
                    var rDictionary = new SortedList <string, string>(StringComparer.OrdinalIgnoreCase);
                    foreach (var rElement in XDocument.Load(rReader).Root.Descendants("String"))
                    {
                        rDictionary[rElement.Attribute("Key").Value] = rElement.Value;
                    }

                    Main     = new StringResourcesItems(rDictionary);
                    IsLoaded = true;
                }
        }
        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;
     }
 }