Detecting when an order is closing in 3.0?

Discussions related to custom development with Select.
Post Reply
BBenson
Posts: 44
Joined: Wed Feb 23, 2011 4:06 pm

Detecting when an order is closing in 3.0?

Post by BBenson »

Hello,

I am subscribing to several PropertyChanged events on properties of the Order object in my Shell package and would like to ensure that the event handlers are detached before the order is closed.
  • Is there a way to determine when the open order in the process of being closed so I can un-subscribe the handlers?
Thanks,
Bob
john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: Detecting when an order is closing in 3.0?

Post by john.morton »

If you add a reference to SoftPro.Select.Shell, you should be able to use GetService to get a reference to the IRuningDocumentsManager2 interface. This interface has the kind of events I believe you're looking for.

Code: Select all

IRunningDocumentsManager2 docManager = selectServer.GetService<IRunningDocumentsManager2>();
docManager.DocumentClosed +=new EventHandler<DocumentEventArgs>(docManager_DocumentClosed);
docManager.DocumentClosing +=new EventHandler<DocumentClosingEventArgs>(docManager_DocumentClosing);
BBenson
Posts: 44
Joined: Wed Feb 23, 2011 4:06 pm

Re: Detecting when an order is closing in 3.0?

Post by BBenson »

Thanks John,

I will take a look.

Bob
Post Reply