Beispiel #1
0
        public static void Load()
        {
            string       broken    = DownloadManager.GetBrokenAddons();
            BrokenObject brokenObj = JsonManager.LoadString <BrokenObject>(broken);

            brokenAddons = brokenObj.addons;
            ToSVersion   = brokenObj.tosversion;
        }
Beispiel #2
0
        private static void LoadLanguageResource(string fileName)
        {
            Assembly assembly     = Assembly.GetExecutingAssembly();
            string   resourceName = assembly.GetManifestResourceNames().Single(str => str.EndsWith(fileName));

            using (Stream stream = assembly.GetManifestResourceStream(resourceName))
            {
                if (stream == null)
                {
                    return;
                }

                using (StreamReader reader = new StreamReader(stream))
                {
                    string _data = reader.ReadToEnd();

                    string langName = fileName.Remove(fileName.Length - 5);

                    LanguageDataObject langObj = JsonManager.LoadString <LanguageDataObject>(_data);

                    translationData.Add(langName.ToLower(), langObj);
                }
            }
        }