Example #1
0
        } // ForceUiCulture

        private static void ForceUiCulture(string culture)
        {
            if (culture == null)
            {
                return;
            }
            culture = culture.Trim();
            if (culture == string.Empty)
            {
                return;
            }

            try
            {
                Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
            }
            catch (Exception ex)
            {
                MyApplication.HandleException(null, Properties.InvariantTexts.ExceptionForceUiCulture, ex);
            } // try-catch
        }     // ForceUiCulture
Example #2
0
        } // DoBackgroundWork

        protected override bool BackgroundWorkCompleted(System.ComponentModel.RunWorkerCompletedEventArgs result)
        {
            if (result.Error != null)
            {
                MyApplication.HandleException(null, Properties.Texts.MyAppCtxExceptionCaption, Properties.Texts.MyAppCtxExceptionMsg, result.Error);
                ExitCode = -1;
                return(false);
            } // if
            if (result.Cancelled)
            {
                ExitCode = -2;
                return(false);
            } // if

            var initResult = result.Result as InitializationResult;

            if ((initResult != null) && (!initResult.IsOk))
            {
                if (initResult.InnerException == null)
                {
                    DisplayMessage(initResult.Caption ?? Properties.Texts.MyAppCtxInitializationErrorCaption,
                                   initResult.Message, MessageBoxIcon.Exclamation, false);
                }
                else
                {
                    DisplayException(initResult.Caption ?? Properties.Texts.MyAppCtxInitializationErrorCaption,
                                     initResult.Message, MessageBoxIcon.Error, false, false, initResult.InnerException);
                } // if-else

                ExitCode = -3;
                return(false);
            } // if

            DisplayProgress(Properties.Texts.MyAppCtxStarting, false);
            return(true);
        } // BackgroundWorkCompleted
Example #3
0
        } // HandleException

        internal static void HandleException(object sender, HandleExceptionEventArgs e)
        {
            MyApplication.HandleException(e.OwnerForm, e.Caption, e.Message, e.Exception);
        } // HandleException
Example #4
0
        } // HandleException

        internal static void HandleException(Form form, ExceptionEventData ex)
        {
            MyApplication.HandleException(form, ex.Caption, ex.Message, ex.Exception);
        } // HandleException
Example #5
0
        } // ShowEpgList

        #endregion

        #region Auxiliary methods: common

        private void ExceptionHandler(string message, Exception ex)
        {
            MyApplication.HandleException(this, message, ex);
        } // ExceptionHandler
Example #6
0
 protected override void ExceptionHandler(CommonBaseForm form, ExceptionEventData ex)
 {
     MyApplication.HandleException(form, ex);
 } // ExceptionHandler
Example #7
0
        } // DoDisplayMessage

        protected override void DoDisplayException(Form splashScreen, string caption, string message, MessageBoxIcon icon, Exception exception)
        {
            MyApplication.HandleException(splashScreen, caption, message ?? Properties.Texts.MyAppCtxExceptionMsg, icon, exception);
        } // DoDisplayException
Example #8
0
        } // Main

        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            MyApplication.HandleException(null, e.Exception);
        } // Application_ThreadException