Esempio n. 1
0
 public static void AsyncUsing(Action action, bool useSymbiosis)
 {
     Task.Run(() =>
     {
         try
         {
             Initialize();
             if (useSymbiosis)
             {
                 Symbiosis.Open();
             }
             action();
         }
         catch (Exception ex)
         {
             LogWrapper.Default.Fatal(ex);
         }
         finally
         {
             if (useSymbiosis)
             {
                 Symbiosis.Close();
             }
             Dispose();
         }
     });
 }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 public static void Using(Action action, bool useSymbiosis)
 {
     try
     {
         Initialize();
         if (useSymbiosis)
         {
             Symbiosis.Open();
         }
         action();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         if (useSymbiosis)
         {
             Symbiosis.Close();
         }
         Dispose();
     }
 }