本文整理汇总了C#中Language.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Language.ShowDialog方法的具体用法?C# Language.ShowDialog怎么用?C# Language.ShowDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language.ShowDialog方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Configuration.Load(out mcConfiguration);
if (string.IsNullOrEmpty(mcConfiguration.LanguageFile) || !File.Exists(mcConfiguration.LanguageFile) || !Translation.Load(mcConfiguration.LanguageFile, out mtTranslation))
{
Language lfLanguage = new Language();
if (lfLanguage.ShowDialog() != DialogResult.OK)
return;
mcConfiguration.LanguageFile = lfLanguage.TranslationPath;
mtTranslation = lfLanguage.Translation;
}
if (args.Length == 1 && File.Exists(args[0]))
Application.Run(new Filemode(args[0]));
while (mbRunning)
switch (mcConfiguration.LastMode)
{
case Programmode.Text:
Application.Run(new Textmode());
break;
case Programmode.File:
Application.Run(new Filemode());
break;
}
Configuration.Save(mcConfiguration);
if (mtTranslation.Changed)
Translation.Save(mtTranslation, mcConfiguration.LanguageFile);
}
示例2: langugeToolStripMenuItem_Click
private void langugeToolStripMenuItem_Click(object sender, EventArgs e)
{
Language formLanguage = new Language(lang);
formLanguage.ShowDialog();
if (formLanguage.DialogResult == DialogResult.OK)
lang =new Languauge( KindLanguage.Russian);
else if (formLanguage.DialogResult == DialogResult.Cancel)
lang = new Languauge(KindLanguage.English);
ChangeLangForm1();
}
示例3: menuItem_language_Click
private void menuItem_language_Click(object sender, System.EventArgs e)
{
Language lang = new Language();
lang.parent_form = this;
lang.ShowDialog();
lang.Dispose();
}
示例4: SetLanguage
private void SetLanguage(object sender, EventArgs e)
{
Language dialog = new Language(ResourceFactory.Culture);
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK && dialog.Culture != ResourceFactory.Culture)
{
if (dialog.Culture == Consts.cnLanguage)
{
ResourceFactory.ResourceCulture = ResourceFactory.CnCultureInfo;
ResourceFactory.ResourceMan = ResourceFactory.CnResourceManager;
Thread.CurrentThread.CurrentUICulture = ResourceFactory.CnCultureInfo;
}
else
{
ResourceFactory.ResourceCulture = ResourceFactory.EnCultureInfo;
ResourceFactory.ResourceMan = ResourceFactory.EnResourceManager;
Thread.CurrentThread.CurrentUICulture = ResourceFactory.EnCultureInfo;
}
ResourceFactory.Culture = dialog.Culture;
InitializeControl();
reload();
}
}
示例5: ToolStripMenuItemSelectLanguage_Click
private void ToolStripMenuItemSelectLanguage_Click(object sender, EventArgs e)
{
Language lfLanguage = new Language(Program.mcConfiguration.LanguageFile);
if (lfLanguage.ShowDialog(this) == DialogResult.OK)
{
Program.mcConfiguration.LanguageFile = lfLanguage.TranslationPath;
Program.mtTranslation = lfLanguage.Translation;
Translate();
}
}