Subject: Kill child thread of plugin section
Prev Next
You are not authorized to post a reply.

Author Messages
Francis LUser is Offline

Posts:33

07/02/2008 6:03 AM  

I have a  plugin dashboard with a plugin section.
In the plugin section, I have a background thread.
Is there anyway that I can capture the shutdown event when
the Interprise Suite is closed?

Thank you very much.

Francis

Ramil DUser is Offline

Posts:223

07/02/2008 8:26 PM  
What you can do is to subscribe to the FormClosing() event of the host form which is the main menu. Below is the sample code for your reference.

1. Create the handler to the event from your plugin section.

AddHandler DirectCast(Host, Interprise.Presentation.Base.BaseForm).FormClosing, AddressOf OnHostClosing

2. Implement the handler

Private Sub OnHostClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs)
' Put your code here
End Sub
Francis LUser is Offline

Posts:33

07/03/2008 6:51 AM  

Ramil,

It works. 

Here is the C# version.

public ImportSection()
:
base()
{
   // This call is required by the Windows Form Designer.
   this.InitializeComponent();

   // Add any initialization after the InitializeComponent() call
   ((Interprise.Presentation.Base.BaseForm)Host).FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OnHostClosing);
}

private void OnHostClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
{
   // clean up code
}


Thank you very much.

Ramil DUser is Offline

Posts:223

07/03/2008 6:35 PM  
Nice! Good job Francis.

You're most welcome.
You are not authorized to post a reply.
Forums > Connected Business Platform > Interprise Suite API Questions > Kill child thread of plugin section



ActiveForums 3.7
Privacy Statement  |  Terms Of Use
Interprise Software Systems International Inc.