8/3/2026 11:09:00 AM
|
| |
| slxdeveloper.com Community Forums |
|
| |
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of .NET Extensions in SalesLogix version 7 and higher. View the code of conduct for posting guidelines.
|
|
|
|
Auto destroy .Net Extension based on extension event.
Posted: 02 Dec 08 3:37 PM
|
Instead of calling the command Application.Managed.Destroy ext to destroy the loaded .Net extension is there a way to have the .net extension destroy itself on a particular event in the extension?
For instance say i have a phone dialer that is called on a click event in an account form. It then monitors the call for various stats like time it took to ring, busy signal, duration of call. On a disconnect event I write to a table all the pertinent details and would like to destroy the .net extension. If i call destroy in Architect after run the extension no longer monitors all the events. |
|
|
|
Re: Auto destroy .Net Extension based on extension event.
Posted: 03 Dec 08 6:51 AM
|
Erdem,
The problem with what you propose is that the .net extensions manager holds a reference to your component. You access this component through the Guid that is provided. Objects do not dispose themselves as this is bad design, the parent that created them is responsible for the disposal, if if they are locally scoped then the garbage collector would dispose them when the callee was out of scope. It also sounds like to me you want your core entension to be around listening and have the internal handlers be disposed. If that is the case then make your extension a simple event handler and create and dispose inner types at will.
Mark |
|
|
|
Re: Auto destroy .Net Extension based on extension event.
Posted: 03 Dec 08 8:56 AM
|
Thanks for the quick reply.
When the phone connection registers as disconnected all the internal handlers are disposed. So it sounds like if I do not destroy it in SLX I am fine since it should be disposed by the garbage collector. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|