コード例 #1
0
        public void WhenUserClickOnAddButton()
        {
            //Add profile
            Language Langobj = new Language();

            Langobj.AddLanguage();
        }
コード例 #2
0
        public static void LoadResources(List <string> packFilenames)
        {
            Log.Info("Resource load requested");
            UnloadResources();

            foreach (var packFilename in packFilenames)
            {
                try
                {
                    var pack = new ResourcePack(Path.Combine("resourcepacks", packFilename));
                    Log.Info($"Adding resource pack {packFilename}");
                    Log.Info($"    {pack.Description.RawText}");
                    LoadedPacks.Add(pack);

                    foreach (var lang in pack.AdditionalLanguages)
                    {
                        Language.AddLanguage(lang, overwrite: false);
                    }
                }
                catch (Exception e)
                {
                    Log.Error($"Couldn't parse resource pack {packFilename}: {e.Message}");
                    throw;
                }
            }

            foreach (var manager in Managers)
            {
                manager.LoadResources();
            }
        }
コード例 #3
0
        public Task InitializeAsync(CancellationToken ct = default)
        {
            foreach (var(key, value) in options)
            {
                if (!string.IsNullOrWhiteSpace(key) && !string.IsNullOrWhiteSpace(value))
                {
                    Language.AddLanguage(key, value);
                }
            }

            return(Task.CompletedTask);
        }
コード例 #4
0
 /// <summary>
 /// Saves the changes.
 /// </summary>
 /// <param name="context">The context.</param>
 public void SaveChanges(IDictionary context)
 {
     if (LanguageId > 0)
     {
         Language.UpdateLanguage(LanguageId, tbLanguageName.Text, FriendlyNameText.Text, IsDefault.IsSelected);
     }
     else
     {
         // add new language
         Language.AddLanguage(tbLanguageName.Text, FriendlyNameText.Text, IsDefault.IsSelected);
     }
 }