I want to close the sub application (which is fileViewer:Window) when it's parrent application would be closed.
Note: this parrent application is not the Main application.
It means I have C# winform application which have 3 levels.
1st is Main application 2nd is Sub application of Main application 3rd is sub application of 2nd
When I close the 2nd application, I want the 3rd application will be closed automatically.
This thread Close another process when application is closing is quite helpfull but I don't know where to call process.close()
or fileViewer.FileBrowser.Dispose();
etc method
public void OpenNewInstanceOf2nd()
{
//Use .NET Diagnostics to start a new process off the 2nd
try
{
System.Diagnostics.Process.Start(MyFramework.FileSystem.ApplicationPath + MyProperties.MyAssemblyName);
}
catch (Exception ex)
{
MyFramework.Debug.LogException(ex, "Could not open the My Utility");
}
}