public static HandleExceptionEx ( string FrindlyMsg, string WTitle, string DevMsg, string DevMethod, MessageBoxIcon MsgIcon ) : void | ||
FrindlyMsg | string | Понятное пользователю сообщение |
WTitle | string | Текст в заголовке сообщения об ошибке |
DevMsg | string | Отладочное сообщение |
DevMethod | string | Метод, вызвавший исключение |
MsgIcon | MessageBoxIcon | Тип иконки: предупреждение, ошибка и т.д. |
return | void |
/// <summary> /// Метод, срабатывающий при возникновении события "загрузка формы". /// </summary> private void FrmHEd_Load(object sender, EventArgs e) { // Проверим используемую платформу... Platform = new CurrentPlatform(); // Проверим наличие прав администратора. Если они отсутствуют - отключим функции сохранения... if (!(ProcessManager.IsCurrentUserAdmin())) { HEd_M_Save.Enabled = false; HEd_T_Save.Enabled = false; HEd_M_RestDef.Enabled = false; HEd_Table.ReadOnly = true; HEd_T_Cut.Enabled = false; HEd_T_Paste.Enabled = false; HEd_T_RemRw.Enabled = false; } // Укажем версию в заголовке главной формы... Text = String.Format(Text, PluginVersion); // Определим расположение файла Hosts... HostsFilePath = FileManager.GetHostsFileFullPath(Platform.OS); // Проверим существование файла... if (File.Exists(HostsFilePath)) { // Запишем путь в статусную строку... HEd_St_Wrn.Text = HostsFilePath; // Считаем содержимое... try { ReadHostsToTable(HostsFilePath); } catch (Exception Ex) { CoreLib.HandleExceptionEx(String.Format(AppStrings.AHE_ExceptionDetected, HostsFilePath), PluginName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } } else { MessageBox.Show(String.Format(AppStrings.AHE_NoFileDetected, HostsFilePath), PluginName, MessageBoxButtons.OK, MessageBoxIcon.Warning); Close(); } }
/// <summary> /// Устанавливает обновление базы данных. /// </summary> /// <param name="ResFileName">Имя файла для обновления</param> /// <param name="UpdateURL">URL загрузки обновления</param> /// <param name="UpdateHash">Контрольная сумма файла обновления</param> /// <returns>Возвращает true при успешной установке обновления, иначе - false.</returns> private bool InstallDatabaseUpdate(string ResFileName, string UpdateURL, string UpdateHash) { // Задаём значения переменных по умолчанию... bool Result = false; // Проверяем наличие прав на запись в каталог... if (FileManager.IsDirectoryWritable(FullAppPath)) { // Генерируем пути к файлам... string UpdateFileName = UpdateManager.GenerateUpdateFileName(Path.Combine(FullAppPath, ResFileName)); string UpdateTempFile = Path.GetTempFileName(); // Загружаем файл с сервера... FormManager.FormShowDownloader(UpdateURL, UpdateTempFile); try { // Проверяем контрольную сумму... if (FileManager.CalculateFileMD5(UpdateTempFile) == UpdateHash) { // Копируем загруженный файл... File.Copy(UpdateTempFile, UpdateFileName, true); // Выводим сообщение об успехе... MessageBox.Show(AppStrings.UPD_UpdateDBSuccessful, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); // Возвращаем положительный результат... Result = true; } else { // Выводим сообщение о несовпадении хешей... MessageBox.Show(AppStrings.UPD_HashFailure, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception Ex) { // Выводим сообщение об ошибке... CoreLib.HandleExceptionEx(AppStrings.UPD_UpdateFailure, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Error); } // Удаляем загруженный файл если он существует... if (File.Exists(UpdateTempFile)) { File.Delete(UpdateTempFile); } // Повторяем поиск обновлений... CheckForUpdates(); } else { // Выводим сообщение об отсутствии прав на запись в каталог... MessageBox.Show(AppStrings.UPD_NoWritePermissions, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error); } // Возвращаем результат... return(Result); }
/// <summary> /// Метод, срабатывающий по окончании работы механизма удаления файлов /// в отдельном потоке. /// </summary> private void RW_Wrk_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { // Удаление завершено. Закроем форму... IsRunning = false; if (e.Error != null) { CoreLib.HandleExceptionEx(AppStrings.RW_RmException, Properties.Resources.AppName, e.Error.Message, e.Error.Source, MessageBoxIcon.Warning); } Close(); }
/// <summary> /// Устанавливает обновление в виде отдельного исполняемого файла. /// </summary> /// <param name="UpdateURL">URL загрузки обновления</param> /// <param name="UpdateHash">Контрольная сумма файла обновления</param> /// <returns>Возвращает true при успешной установке обновления, иначе - false.</returns> private bool InstallBinaryUpdate(string UpdateURL, string UpdateHash) { // Задаём значения переменных по умолчанию... bool Result = false; // Генерируем имя файла обновления... string UpdateFileName = UpdateManager.GenerateUpdateFileName(Path.Combine(AppUserDir, Path.GetFileName(UpdateURL))); // Загружаем файл асинхронно... FormManager.FormShowDownloader(UpMan.AppUpdateURL, UpdateFileName); // Выполняем проверки и устанавливаем обновление... if (File.Exists(UpdateFileName)) { // Проверяем хеш загруженного файла с эталоном... if (FileManager.CalculateFileMD5(UpdateFileName) == UpdateHash) { // Обновляем дату последней проверки обновлений... UpdateTimeSetApp(); // Выводим сообщение об успешном окончании загрузки и готовности к установке обновления... MessageBox.Show(AppStrings.UPD_UpdateSuccessful, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); // Запускаем установку standalone-обновления... try { if (FileManager.IsDirectoryWritable(FullAppPath)) { Process.Start(UpdateFileName); } else { ProcessManager.StartWithUAC(UpdateFileName); } Result = true; } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.UPD_UpdateFailure, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Error); } } else { // Хеш-сумма не совпала, поэтому файл скорее всего повреждён. Удаляем... try { File.Delete(UpdateFileName); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } // Выводим сообщение о несовпадении контрольной суммы... MessageBox.Show(AppStrings.UPD_HashFailure, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { // Не удалось загрузить файл обновления. Выводим сообщение об ошибке... MessageBox.Show(AppStrings.UPD_UpdateFailure, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Warning); } // Повторно запускаем проверку обновлений... CheckForUpdates(); // Возвращаем результат... return(Result); }
/// <summary> /// Метод, срабатывающий при нажатии на кнопку "Очистить журнал". /// </summary> private void LV_MunuFileClearLog_Click(object sender, EventArgs e) { // Очистим форму... LV_LogArea.Clear(); // Очистим файл журнала... try { if (File.Exists(LogFileName)) { File.Delete(LogFileName); FileManager.CreateFile(LogFileName); } } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.LV_ClearEx, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } }
/// <summary> /// Метод, срабатывающий при нажатии на кнопку сохранения. /// </summary> private void WriteTable(object sender, EventArgs e) { try { if (Properties.Settings.Default.SafeCleanup) { if (File.Exists(Banlist)) { FileManager.CreateConfigBackUp(Banlist, BackUpDir, Properties.Resources.BU_PrefixVChat); } } WriteTableToFile(Banlist); MessageBox.Show(AppStrings.MM_SavedOK, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.MM_SaveException, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } }
/// <summary> /// Метод, срабатывающий при нажатии кнопки отмены произведённых изменений. /// </summary> private void Dis_Restore_Click(object sender, EventArgs e) { // Восстанавливаем настройки по умолчанию... if (MessageBox.Show(AppStrings.KB_ExRestore, Properties.Resources.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { DeleteKBS("Scancode Map"); MessageBox.Show(AppStrings.KB_ExSuccess, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); Close(); } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.KB_ExException, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } } }
/// <summary> /// Метод, срабатывающий при нажатии кнопки отключения обеих клавиш WIN. /// </summary> private void Dis_BWIN_Click(object sender, EventArgs e) { // Отключаем обе клавиши WIN... // 00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00 if (MessageBox.Show(String.Format(AppStrings.KB_ExQuestion, ((Button)sender).Text.ToLower()), Properties.Resources.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { WriteKBS(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 91, 224, 0, 0, 92, 224, 0, 0, 0, 0 }); MessageBox.Show(AppStrings.KB_ExSuccess, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information); Close(); } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.KB_ExException, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } } }
/// <summary> /// Метод, срабатывающий при нажатии на кнопку обновления таблицы. /// </summary> private void UpdateTable(object sender, EventArgs e) { try { MM_Table.Rows.Clear(); ReadFileToTable(Banlist); } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.MM_ExceptionDetected, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } }
/// <summary> /// Метод, срабатывающий при нажатии на кнопку "Обновить". /// </summary> private void HEd_T_Refresh_Click(object sender, EventArgs e) { try { ReadHostsToTable(HostsFilePath); } catch (Exception Ex) { CoreLib.HandleExceptionEx(String.Format(AppStrings.AHE_ExceptionDetected, HostsFilePath), PluginName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } }
/// <summary> /// Начинает процесс сохранения таблицы в файл. /// </summary> private void SaveToFile() { if (ProcessManager.IsCurrentUserAdmin()) { try { WriteTableToHosts(HostsFilePath); MessageBox.Show(AppStrings.AHE_Saved, PluginName, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception Ex) { CoreLib.HandleExceptionEx(String.Format(AppStrings.AHE_SaveException, HostsFilePath), PluginName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } } else { MessageBox.Show(String.Format(AppStrings.AHE_NoAdminRights, HostsFilePath), PluginName, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Метод, работающий в отдельном потоке при запуске механизма создания /// отчёта. /// </summary> private void BwGen_DoWork(object sender, DoWorkEventArgs e) { // Сгенерируем путь для каталога с рапортами... string RepDir = Path.Combine(AppUserDir, "reports"); // Проверим чтобы каталог для рапортов существовал... if (!Directory.Exists(RepDir)) { // Не существует, поэтому создадим... Directory.CreateDirectory(RepDir); } // Генерируем пути к каталогам для вреенных файлов и создаём их... string TempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); string CrDt = FileManager.DateTime2Unix(DateTime.Now); if (!Directory.Exists(TempDir)) { Directory.CreateDirectory(TempDir); } // Генерируем именя файлов с полными путями... string RepName = String.Format("report_{0}.{1}", CrDt, "txt"); string ArchName = Path.Combine(RepDir, Path.ChangeExtension(RepName, ".zip")); string HostsFile = FileManager.GetHostsFileFullPath(CurrentPlatform.OSType.Windows); string FNameRep = Path.Combine(TempDir, RepName); string FNameInternal = Path.Combine(AppUserDir, Properties.Resources.DebugLogFileName); string FNameFPSCfg = Path.Combine(TempDir, String.Format("fpscfg_{0}.zip", CrDt)); string FNamePing = Path.Combine(TempDir, String.Format("ping_{0}.log", CrDt)); string FNameTrace = Path.Combine(TempDir, String.Format("traceroute_{0}.log", CrDt)); string FNameIpConfig = Path.Combine(TempDir, String.Format("ipconfig_{0}.log", CrDt)); string FNameRouting = Path.Combine(TempDir, String.Format("routing_{0}.log", CrDt)); string FNameNetStat = Path.Combine(TempDir, String.Format("netstat_{0}.log", CrDt)); string FNameDxDiag = Path.Combine(TempDir, String.Format("dxdiag_{0}.log", CrDt)); // Начинаем сборку отчёта... try { // Генерируем основной отчёт... try { ProcessManager.StartProcessAndWait("msinfo32.exe", String.Format("/report \"{0}\"", FNameRep)); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } // Если пользователь вдруг отменил его создание, больше ничего не делаем... if (File.Exists(FNameRep)) { // Запускаем последовательность... try { ProcessManager.StartProcessAndWait("dxdiag.exe", String.Format("/t {0}", FNameDxDiag)); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } /* DxDiag неадекватно реагирует на кавычки в пути. */ try { if (SelectedGame.FPSConfigs.Count > 0) { FileManager.CompressFiles(SelectedGame.FPSConfigs, FNameFPSCfg); } } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } try { ProcessManager.StartProcessAndWait("cmd.exe", String.Format("/C ping steampowered.com > \"{0}\"", FNamePing)); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } try { ProcessManager.StartProcessAndWait("cmd.exe", String.Format("/C tracert steampowered.com > \"{0}\"", FNameTrace)); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } try { ProcessManager.StartProcessAndWait("cmd.exe", String.Format("/C ipconfig /all > \"{0}\"", FNameIpConfig)); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } try { ProcessManager.StartProcessAndWait("cmd.exe", String.Format("/C netstat -a > \"{0}\"", FNameNetStat)); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } try { ProcessManager.StartProcessAndWait("cmd.exe", String.Format("/C route print > \"{0}\"", FNameRouting)); } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } try { // Создаём Zip-архив... using (ZipFile ZBkUp = new ZipFile(ArchName, Encoding.UTF8)) { // Добавляем в архив созданный рапорт... if (File.Exists(FNameRep)) { ZBkUp.AddFile(FNameRep, "report"); } // Добавляем в архив все конфиги выбранной игры... if (Directory.Exists(SelectedGame.FullCfgPath)) { ZBkUp.AddDirectory(SelectedGame.FullCfgPath, "configs"); } if (SelectedGame.IsUsingVideoFile) { string GameVideo = SelectedGame.GetActualVideoFile(); if (File.Exists(GameVideo)) { ZBkUp.AddFile(GameVideo, "video"); } } // Добавляем в архив все краш-дампы и логи Steam... if (Directory.Exists(Path.Combine(FullSteamPath, "dumps"))) { ZBkUp.AddDirectory(Path.Combine(FullSteamPath, "dumps"), "dumps"); } if (Directory.Exists(Path.Combine(FullSteamPath, "logs"))) { ZBkUp.AddDirectory(Path.Combine(FullSteamPath, "logs"), "logs"); } // Добавляем содержимое файла Hosts... if (File.Exists(HostsFile)) { ZBkUp.AddFile(HostsFile, "hosts"); } // Добавляем в архив отчёты утилит ping, трассировки и т.д. if (File.Exists(FNamePing)) { ZBkUp.AddFile(FNamePing, "system"); } if (File.Exists(FNameTrace)) { ZBkUp.AddFile(FNameTrace, "system"); } if (File.Exists(FNameIpConfig)) { ZBkUp.AddFile(FNameIpConfig, "system"); } if (File.Exists(FNameRouting)) { ZBkUp.AddFile(FNameRouting, "system"); } if (File.Exists(FNameNetStat)) { ZBkUp.AddFile(FNameNetStat, "system"); } if (File.Exists(FNameDxDiag)) { ZBkUp.AddFile(FNameDxDiag, "system"); } if (File.Exists(FNameFPSCfg)) { ZBkUp.AddFile(FNameFPSCfg, "fps"); } // Добавляем в архив журнал программы... try { if (File.Exists(FNameInternal)) { if (FileManager.GetFileSize(FNameInternal) > 0) { ZBkUp.AddFile(FNameInternal, "srcrep"); } } } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } // Сохраняем архив... ZBkUp.Save(); } // Выводим сообщение об успешном создании отчёта... MessageBox.Show(String.Format(AppStrings.RPB_ComprGen, Path.GetFileName(ArchName)), PluginName, MessageBoxButtons.OK, MessageBoxIcon.Information); // Открываем каталог с отчётами в оболочке и выделяем созданный файл... if (File.Exists(ArchName)) { ProcessManager.OpenExplorer(ArchName, CurrentPlatform.OSType.Windows); } } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.PS_ArchFailed, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } } // Выполняем очистку... try { // Удаляем не сжатый отчёт... if (File.Exists(FNameRep)) { File.Delete(FNameRep); } // Удаляем временный каталог... if (Directory.Exists(TempDir)) { Directory.Delete(TempDir, true); } } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } } catch (Exception Ex) { // Произошло исключение... CoreLib.HandleExceptionEx(AppStrings.RPB_GenException, PluginName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } }
/// <summary> /// Метод, срабатывающий асинхронно при запуске механизма очистки. /// </summary> private void ClnWrk_DoWork(object sender, DoWorkEventArgs e) { try { // Задаём массив для хранения имён удаляемых файлов... List <string> DeleteQueue = new List <string>(); // Добавляем в очередь для очистки... Invoke((MethodInvoker) delegate() { CM_Info.Text = AppStrings.PS_ProcessPrepare; foreach (ListViewItem LVI in CM_FTable.Items) { if (LVI.Checked) { DeleteQueue.Add(LVI.ToolTipText); } } }); // Добавляем в архив (если выбрано)... if (Properties.Settings.Default.PackBeforeCleanup || ForceBackUp) { Invoke((MethodInvoker) delegate() { CM_Info.Text = AppStrings.PS_ProgressArchive; }); if (!FileManager.CompressFiles(DeleteQueue, FileManager.GenerateBackUpFileName(FullBackUpDirPath, Properties.Resources.BU_PrefixDef))) { MessageBox.Show(AppStrings.PS_ArchFailed, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error); } } // Меняем текст в строке статуса... Invoke((MethodInvoker) delegate() { CM_Info.Text = AppStrings.PS_ProgressCleanup; }); // Формируем счётчики... int TotalFiles = DeleteQueue.Count; int i = 1, j = 0; // Удаляем файлы из очереди очистки... foreach (string Fl in DeleteQueue) { try { j = (int)Math.Round(((double)i / (double)TotalFiles * (double)100.00), 0); i++; if ((j >= 0) && (j <= 100)) { ClnWrk.ReportProgress(j); } } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } try { if (File.Exists(Fl)) { File.SetAttributes(Fl, FileAttributes.Normal); File.Delete(Fl); } } catch (Exception Ex) { CoreLib.WriteStringToLog(Ex.Message); } } // Удалим пустые каталоги (если разрешено)... if (Properties.Settings.Default.RemoveEmptyDirs) { try { foreach (string Dir in CleanDirs) { FileManager.RemoveEmptyDirectories(Path.GetDirectoryName(Dir)); } } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.PS_CleanEmptyDirsError, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } } } catch (Exception Ex) { // Произошло исключение... CoreLib.HandleExceptionEx(AppStrings.PS_CleanupErr, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } }
/// <summary> /// Метод, срабатывающий при нажатии кнопки, запускающей установку. /// </summary> private void BtnInstall_Click(object sender, EventArgs e) { // А здесь собственно установка... if (!(String.IsNullOrEmpty(InstallPath.Text))) { try { // Сгенерируем путь... string InstallDir = IsUsingUserDir ? Path.Combine(CustomInstallDir, Properties.Settings.Default.UserCustDirName) : FullGamePath; // У нас множество алгоритмов, поэтому придётся делать проверки... switch (Path.GetExtension(InstallPath.Text)) { // Будем устанавливать демку... case ".dem": InstallFileNow(InstallPath.Text, FullGamePath); break; // Будем устанавливать пакет... case ".vpk": InstallFileNow(InstallPath.Text, CustomInstallDir); break; // Будем устанавливать конфиг... case ".cfg": InstallFileNow(InstallPath.Text, Path.Combine(InstallDir, "cfg")); break; // Будем устанавливать карту... case ".bsp": InstallFileNow(InstallPath.Text, Path.Combine(InstallDir, "maps")); break; // Будем устанавливать хитсаунд... case ".wav": InstallFileNow(InstallPath.Text, Path.Combine(InstallDir, "sound", "ui")); break; // Будем устанавливай спрей... case ".vtf": InstallSprayNow(InstallPath.Text); break; // Будем устанавливать содержимое архива... case ".zip": FormManager.FormShowArchiveExtract(InstallPath.Text, CustomInstallDir); break; // Будем устанавливать бинарный модуль (плагин)... case ".dll": InstallFileNow(InstallPath.Text, Path.Combine(InstallDir, "addons")); break; } // Выведем сообщение... MessageBox.Show(AppStrings.QI_InstSuccessfull, PluginName, MessageBoxButtons.OK, MessageBoxIcon.Information); // Закрываем окно... Close(); } catch (Exception Ex) { // Произошло исключение, выведем сообщение... CoreLib.HandleExceptionEx(AppStrings.QI_Excpt, PluginName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } } else { // Пользователь ничего не выбрал для установки, укажем ему на это... MessageBox.Show(AppStrings.QI_InstUnav, PluginName, MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
/// <summary> /// Загружает содержимое журнала в TextBox на форме. /// </summary> /// <param name="FileName">Путь к файлу журнала</param> private void LoadLog(string FileName) { try { LoadTextFile(FileName); } catch (Exception Ex) { CoreLib.HandleExceptionEx(AppStrings.LV_LoadFailed, Properties.Resources.AppName, Ex.Message, Ex.Source, MessageBoxIcon.Warning); } }