public static object DoInTransaction(IDesignerHost theHost, string theTransactionName, TransactionAwareParammedMethod theMethod, object theParam) { DesignerTransaction transaction = null; object obj2 = null; try { transaction = theHost.CreateTransaction(theTransactionName); obj2 = theMethod(theHost, theParam); } catch (CheckoutException exception) { if (exception != CheckoutException.Canceled) { throw exception; } } catch { if (transaction != null) { transaction.Cancel(); transaction = null; } throw; } finally { if (transaction != null) { transaction.Commit(); } } return obj2; }
public static object DoInTransaction( IDesignerHost theHost, string theTransactionName, TransactionAwareParammedMethod theMethod, object theParam) { DesignerTransaction aTran = null; object aRetVal = null; try { aTran = theHost.CreateTransaction(theTransactionName); aRetVal = theMethod(theHost, theParam); // do the task polymorphically } catch (CheckoutException theEx) // something has gone wrong with transaction creation { if (theEx != CheckoutException.Canceled) { throw theEx; } } catch { if (aTran != null) { aTran.Cancel(); aTran = null; // the transaction won't commit in the finally block } throw; } finally { if (aTran != null) { aTran.Commit(); } } return(aRetVal); }
public static object DoInTransaction( IDesignerHost theHost, string theTransactionName, TransactionAwareParammedMethod theMethod, object theParam) { DesignerTransaction aTran = null; object aRetVal = null; try { aTran = theHost.CreateTransaction(theTransactionName); aRetVal = theMethod(theHost, theParam); // do the task polymorphically } catch (CheckoutException theEx) // something has gone wrong with transaction creation { if (theEx != CheckoutException.Canceled) throw theEx; } catch { if (aTran != null) { aTran.Cancel(); aTran = null; // the transaction won't commit in the finally block } throw; } finally { if (aTran != null) aTran.Commit(); } return aRetVal; }
public static object DoInTransaction(IDesignerHost host, string transactionName, TransactionAwareParammedMethod method, object param) { DesignerTransaction tran = null; object retVal = null; try { tran = host.CreateTransaction(transactionName); retVal = method(host, param); } catch (CheckoutException ex) { if (ex != CheckoutException.Canceled) { throw ex; } } catch { if (tran != null) { tran.Cancel(); tran = null; } throw; } finally { if (tran != null) { tran.Commit(); } } return(retVal); }
public static object DoInTransaction(IDesignerHost theHost, string theTransactionName, TransactionAwareParammedMethod theMethod, object theParam) { DesignerTransaction transaction = null; object obj2 = null; try { transaction = theHost.CreateTransaction(theTransactionName); obj2 = theMethod(theHost, theParam); } catch (CheckoutException exception) { if (exception != CheckoutException.Canceled) { throw exception; } } catch { if (transaction != null) { transaction.Cancel(); transaction = null; } throw; } finally { if (transaction != null) { transaction.Commit(); } } return(obj2); }