public static ShowErrorMessage ( string text, string title = null ) : void | ||
text | string | |
title | string | |
Résultat | void |
public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new FormMain()); } catch (System.IO.FileNotFoundException e) { Helpers.ShowErrorMessage(Resources.FormMain_CouldNotFindFile.Replace("FILENAME", e.FileName), Resources.Error); } }
public static void Main() { if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new FormMain()); } catch (System.IO.FileNotFoundException e) { Helpers.ShowErrorMessage(Resources.FormMain_CouldNotFindFile.Replace("FILENAME", e.FileName)); } }
public FormMain() { InitializeComponent(); Text = string.Format(Resources.FormMainTitle, typeof(FormMain).Assembly.GetName().Version); FormBorderStyle = FormBorderStyle.FixedSingle; //set language menu items for checking languageMenuItems.Add("de", deutschToolStripMenuItem); languageMenuItems.Add("en", englishToolStripMenuItem); languageMenuItems.Add("es", espanolToolStripMenuItem); languageMenuItems.Add("fr", francaisToolStripMenuItem); languageMenuItems.Add("it", italianoToolStripMenuItem); languageMenuItems.Add("nl", nederlandsToolStripMenuItem); languageMenuItems.Add("pl", polishToolStripMenuItem); //get language var appSettingsFilePath = $"{Paths.ExePath}\\{Paths.AppSettingsName}"; if (File.Exists(appSettingsFilePath)) { var json = File.ReadAllText(appSettingsFilePath, Encoding.Default); var appSettings = JsonConvert.DeserializeObject <AppSettings>(json); _language = appSettings.Language; } setCheckOfLanguageInMenu(true); _moddingService = new ModdingService(); _progressBarManipulator = new ProgressBarManipulator(modProgressStatusBar); if (!File.Exists($"{Paths.ExePath}\\{Paths.WigglesExecutableName}")) { Helpers.ShowErrorMessage(Resources.FormMain_CouldNotFindWigglesExeErrorText, Resources.Error); } else { ResetStatusNote(); ReadMods(); } }