Beispiel #1
0
 public static void channel_Exception_Log <T>(T t, Action <T> methodExecute, string exceptionLogTitle = "ERROR")
 {
     try
     {
         methodExecute(t);   //arguments is
     }
     catch (Exception ex)
     {
         Log_Helper_File_DG.Log_Error(ex.ToString(), exceptionLogTitle);
     }
 }
Beispiel #2
0
 public static E channel_Exception_Log <T, E>(T t, Func <T, E> methodExecute, string exceptionLogTitle = "ERROR")
 {
     try
     {
         return(methodExecute(t));    //arguments is t
     }
     catch (Exception ex)
     {
         Log_Helper_File_DG.Log_Error(ex.ToString(), exceptionLogTitle);
         return(default(E));
     }
 }
Beispiel #3
0
 public static E channel_Exception_Log <T, E>(T t, Predicate <T> conditionExecute, Func <T, E> methodExecute, Func <E> exceptionExecute)
 {
     try
     {
         return(conditionExecute(t) == true?methodExecute(t) : exceptionExecute());
     }
     catch (Exception ex)
     {
         Log_Helper_File_DG.Log_Error(ex.ToString());
         return(exceptionExecute());
     }
 }
Beispiel #4
0
 public static E channel_Exception_Log <T, E>(T t, Func <T, E> methodExecute, Func <E> exceptionExecute)
 {
     try
     {
         return(methodExecute(t));    //arguments is t
     }
     catch (Exception ex)
     {
         Log_Helper_File_DG.Log_Error(ex.ToString());
         return(exceptionExecute());
     }
 }
Beispiel #5
0
 public static void channel_Exception_Log(Action methodExecute, Action exceptionExecute, string exceptionLogTitle = "ERROR")
 {
     try
     {
         methodExecute();    //no arguments
     }
     catch (Exception ex)
     {
         Log_Helper_File_DG.Log_Error(ex.ToString(), exceptionLogTitle);
         exceptionExecute();
     }
 }
Beispiel #6
0
 public static E channel_Exception_Log <E>(Func <E> methodExecute, Func <E> exceptionExecute, string exceptionLogTitle = "ERROR")
 {
     try
     {
         return(methodExecute()); //no arguments
     }
     catch (Exception ex)
     {
         Log_Helper_File_DG.Log_Error(ex.ToString(), exceptionLogTitle);
         return(exceptionExecute());
     }
 }
Beispiel #7
0
 public static E channel_Exception_Log <T, E>(T t, Predicate <T> conditionExecute, Func <T, E> methodExecute, string exceptionLogTitle = "ERROR")
 {
     try
     {
         return(conditionExecute(t) == true?methodExecute(t) : default(E));
     }
     catch (Exception ex)
     {
         Log_Helper_File_DG.Log_Error(ex.ToString(), exceptionLogTitle);
         return(default(E));
     }
 }