コード例 #1
0
        public static void HandleError(ThemeError e)
        {
            if (taskbarHandle != IntPtr.Zero)
            {
                TaskbarProgress.SetState(taskbarHandle, TaskbarProgress.TaskbarStates.Error);
            }

            if (ThemeManager.downloadMode || ThemeManager.importMode)
            {
                MessageDialog.ShowWarning(string.Format(_("Failed to import '{0}' theme:\n{1}"), e.themeId, e.errorMsg),
                                          _("Error"));
            }
            else
            {
                DialogResult result = MessageDialog.ShowQuestion(string.Format(_("Failed to load '{0}' theme:\n{1}\n" +
                                                                                 "\nDo you want to disable this theme to prevent the error from happening again?"), e.themeId,
                                                                               e.errorMsg), _("Error"), true);
                ThemeManager.DisableTheme(e.themeId, result == DialogResult.Yes);
            }

            if (taskbarHandle != IntPtr.Zero)
            {
                TaskbarProgress.SetState(taskbarHandle, TaskbarProgress.TaskbarStates.Normal);
            }
        }
コード例 #2
0
        public static void HandleError(string themeId)
        {
            if (errorMsg == null)
            {
                return;
            }

            if (taskbarHandle != IntPtr.Zero)
            {
                TaskbarProgress.SetState(taskbarHandle, TaskbarProgress.TaskbarStates.Error);
            }

            if (!ThemeManager.importMode)
            {
                DialogResult result = MessageBox.Show(string.Format(_("Failed to load '{0}' " +
                                                                      "theme:\n{1}\n\nDo you want to disable this theme to prevent the error from " +
                                                                      "happening again?"), themeId, errorMsg), _("Error"), MessageBoxButtons.YesNo,
                                                      MessageBoxIcon.Warning);
                ThemeManager.DisableTheme(themeId, result == DialogResult.Yes);
            }
            else
            {
                MessageBox.Show(string.Format(_("Failed to import '{0}' theme:\n{1}"), themeId,
                                              errorMsg), _("Error"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            if (taskbarHandle != IntPtr.Zero)
            {
                TaskbarProgress.SetState(taskbarHandle, TaskbarProgress.TaskbarStates.Normal);
            }

            errorMsg = null;
        }