protected override void Dispose(bool disposing)
{
if (this.isDisposed)
{
return;
}
try
{
try
{
this.UnRegisterProject();
}
finally
{
try
{
this.RegisterClipboardNotifications(false);
}
finally
{
try
{
if (this.projectEventsProvider != null)
{
this.projectEventsProvider.AfterProjectFileOpened -= this.OnAfterProjectOpen;
}
if (this.taskProvider != null)
{
taskProvider.Tasks.Clear();
this.taskProvider.Dispose();
this.taskProvider = null;
}
if (this.buildLogger != null)
{
this.buildLogger.Shutdown();
buildLogger = null;
}
if (this.site != null)
{
this.site.Dispose();
}
}
finally
{
this.buildEngine = null;
}
}
}
if (this.buildProject != null)
{
this.buildProject.ProjectCollection.UnloadProject(this.buildProject);
try { this.buildProject.ProjectCollection.UnloadProject(this.buildProject.Xml); }
catch (Exception ex) { Trace.WriteLine("Exception : " + ex.Message); }
this.buildProject = null;
}
if (null != imageHandler)
{
imageHandler.Close();
imageHandler = null;
}
}
finally
{
base.Dispose(disposing);
this.isDisposed = true;
}
}