日期:2014-05-17 浏览次数:21036 次
public class Lan
{
private static List<CultureInfo> areas = new List<CultureInfo>();
private static int current = 0;
/// <summary>
/// 切换语言(默认和日语)
/// </summary>
/// <param name="form"></param>
public static void SwitchLang(Form form)
{
if (areas.Count == 0)
{
areas.Add(Thread.CurrentThread.CurrentCulture);
areas.Add(new CultureInfo("ja"));
}
current = (current + 1) % 2;
Thread.CurrentThread.CurrentUICulture = areas[current];
if (form != null)
{
SetLang(form);
}
}
/// <summary>
/// 设置当前线程的语言与主窗体相同
/// </summary>
public static void SetLang()
{
if (current < areas.Count)
{
Thread.CurrentThread.CurrentUICulture = areas[current];
}
}
public static void SetLang(Form form)