コード例 #1
0
 public static void LogErrorNow(
     Exception e,
     int portIndex       = 1,
     bool forceException = true)
 {
     Errors.GetInstance()._LogErrorNow(e, portIndex);
     Errors.LaunchException(e, forceException);
 }
コード例 #2
0
ファイル: Errors.cs プロジェクト: allanonace/MTUProg1.37.3
 /// <summary>
 /// Registers a new error based on an exception, shows a popup alert using
 /// this last error and also registers in the ( activity or result ) log file
 /// </summary>
 /// <param name="e">Exception that represents the last error happened</param>
 /// <param name="portIndex">Index of MTU port associated to the error</param>
 /// <param name="forceException">Forces to launch/throw the exception</param>
 public static void LogErrorNow(
     Exception e,
     int portIndex       = -1,
     bool forceException = true)
 {
     if (!IsOwnException(e))
     {
         Errors.GetInstance()._LogErrorNow(e, portIndex, forceException);
     }
     else
     {
         Errors.GetInstance()._LogErrorNow(e, ((portIndex > -1) ? portIndex : (( OwnExceptionsBase )e).Port), forceException);
     }
 }
コード例 #3
0
ファイル: Errors.cs プロジェクト: allanonace/MTUProg1.37.3
        /// <summary>
        /// Both options will log all registered exceptions that remain, but in
        /// the first case previously the last exception launched will be added
        /// </summary>
        /// <param name="e">Exception that represents the last error happened</param>
        public static void LogRemainExceptions(
            Exception e)
        {
            // Last exception was not added yet
            if (!Errors.GetInstance().IsLastExceptionUsed(e))
            {
                Errors.LogErrorNow(e, -1, false);
            }

            // Last exception was already added
            else
            {
                Errors.LogRegisteredErrors();
            }
        }
コード例 #4
0
ファイル: Errors.cs プロジェクト: allanonace/MTUProg1.37.3
 public async static Task ShowAlert(
     Exception e)
 {
     await Errors.GetInstance()._ShowAlert(e);
 }
コード例 #5
0
ファイル: Errors.cs プロジェクト: allanonace/MTUProg1.37.3
 public static void LogRegisteredErrors(
     bool forceException = false)
 {
     Errors.GetInstance()._LogRegisteredErrors(forceException);
 }
コード例 #6
0
ファイル: Errors.cs プロジェクト: allanonace/MTUProg1.37.3
 /// <summary>
 /// Used during the initialization process, when the app
 /// is not loaded yet and the error forces to close the app
 /// </summary>
 /// <param name="e">Exception that represents the last error happened</param>
 public static void LogErrorNowAndKill(
     Exception e)
 {
     Errors.GetInstance()._LogErrorNow(e, 1, false, true);     // Port index has not importance in this case
 }
コード例 #7
0
ファイル: Errors.cs プロジェクト: allanonace/MTUProg1.37.3
 /// <summary>
 /// Registers a new error based on an ( own or .Net ) exception
 /// </summary>
 /// <param name="e">Exception that represents the last error happened</param>
 /// <param name="portIndex">MTU port index related</param>
 public static void AddError(
     Exception e,
     int portIndex = 1)
 {
     Errors.GetInstance().AddErrorByException(e, portIndex);
 }
コード例 #8
0
ファイル: Errors.cs プロジェクト: allanonace/MTUProg1.37.3
 /// <summary>
 /// Gets all errors registered to log, used from class Logger
 /// </summary>
 /// <returns>Array of registered errors</returns>
 /// <param name="clearList">Clear list of registered errors after being returned</param>
 public static Error[] GetErrorsToLog(
     bool clearList = true)
 {
     return(Errors.GetInstance()._GetErrorsToLog(clearList));
 }