"Albert Szilvasy" wrote
>> I would use AutoDelete. What is the context when you need this?
See System.ComponentModel.Design.DesignerTransaction
On further reflection, AutoDelete really doesn't solve the problem,
and neither do events that notify me that a transaction has ended.
Consider this:
Transaction trOuterMost = .StartTransaction(); // client does this
{
// do stuff here
Transaction trMiddle = .StartTransaction(); // client does this
{
// do more stuff here....
// I need to know if the following was aborted:
Transaction trInnerMost = .StartTransaction(); // I do this
{
// Do stuff here
trOuterMost.Abort(); // client gets control (via an event)
// and does this, which
// aborts all of the above.
If I'm not mistaken, AutoDelete will not reflect the fact that the
wrapped AcDbTransactions for all but the one whose Abort()
member was called, have ended. But perhaps I'm wrong?
After giving it just a little thought, it looks like the critical
notifications that we actually need are not transactionAborted()
or transactionEnded() (these can be rendered as properties).
What we really need are transactionAboutToEnd/Abort() because
my situation requires me to take certain actions within the ending
transaction's boundary. The basic problem stems from the fact
that when I fire events at the client, they get control within the
boundary of my 'innermost' transaction, which allows them to
abort an outer transaction, along with all others started after it.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
The notifications are not there because you have to draw a line somewhere if
you want to ship software.:-)
Albert
"Tony Tanzillo" wrote in message
news:4871095@discussion.autodesk.com...
Is there an 'official' way to find out if a Transaction has
ended (aborted or commited) ?
It looks like DisposableWrapper.get_AutoDelete() is one
way to tell, but seems a bit flimsy.
And, why doesn't TransactionManager expose any of the
AcTransactionReactor notifications?
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com