コード例 #1
0
 // 根据主语言索引返回主语言
 public Lang GetMainLangByMainLangIndex(int index)
 {
     if (MainLangList.Any(x => x.Value.MainLangIndex == index))
     {
         return(MainLangList.FirstOrDefault(x => x.Value.MainLangIndex == index).Value);
     }
     return(MainLangList[0]);
 }
コード例 #2
0
 /// <summary>
 /// 根据主语言名返回索引
 /// </summary>
 /// <param name="LangName"></param>
 /// <returns></returns>
 public Lang GetMainLangByLangName(string LangName)
 {
     if (MainLangList.Any(x => x.Value.LangName == LangName))
     {
         return(MainLangList.FirstOrDefault(x => x.Value.LangName == LangName).Value);
     }
     else
     {
         return(MainLang);
     }
 }