|
|
|
@ -5,11 +5,11 @@
@@ -5,11 +5,11 @@
|
|
|
|
|
// <version>$Revision$</version>
|
|
|
|
|
// </file>
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.Core; |
|
|
|
|
using System; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Windows.Forms; |
|
|
|
|
using System.Windows.Forms.Integration; |
|
|
|
|
|
|
|
|
|
using ICSharpCode.Core.Presentation; |
|
|
|
|
using ICSharpCode.Profiler.Controller.Data; |
|
|
|
|
using ICSharpCode.SharpDevelop; |
|
|
|
@ -54,7 +54,15 @@ namespace ICSharpCode.Profiler.AddIn.Views
@@ -54,7 +54,15 @@ namespace ICSharpCode.Profiler.AddIn.Views
|
|
|
|
|
/// </summary>
|
|
|
|
|
public WpfViewer(OpenedFile file) |
|
|
|
|
{ |
|
|
|
|
//this.Files.Add(file);
|
|
|
|
|
// HACK : OpenedFile architecture does not allow to keep files open
|
|
|
|
|
// but it is necessary for the ProfilerView to keep the session file open.
|
|
|
|
|
// We don't want to load all session data into memory.
|
|
|
|
|
// this.Files.Add(file);
|
|
|
|
|
|
|
|
|
|
// HACK : The file is not recognised by the FileService for closing if it is deleted while open.
|
|
|
|
|
// (reason see above comment)
|
|
|
|
|
FileService.FileRemoving += FileServiceFileRemoving; |
|
|
|
|
|
|
|
|
|
this.file = file; |
|
|
|
|
this.provider = ProfilingDataSQLiteProvider.FromFile(file.FileName); |
|
|
|
|
this.TabPageText = Path.GetFileName(file.FileName); |
|
|
|
@ -69,6 +77,13 @@ namespace ICSharpCode.Profiler.AddIn.Views
@@ -69,6 +77,13 @@ namespace ICSharpCode.Profiler.AddIn.Views
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FileServiceFileRemoving(object sender, FileCancelEventArgs e) |
|
|
|
|
{ |
|
|
|
|
if (FileUtility.IsEqualFileName(e.FileName, file.FileName) || |
|
|
|
|
FileUtility.IsBaseDirectory(e.FileName, file.FileName)) |
|
|
|
|
this.WorkbenchWindow.CloseWindow(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Refreshes the view
|
|
|
|
|
/// </summary>
|
|
|
|
@ -86,6 +101,8 @@ namespace ICSharpCode.Profiler.AddIn.Views
@@ -86,6 +101,8 @@ namespace ICSharpCode.Profiler.AddIn.Views
|
|
|
|
|
this.dataView.SaveUserState(); |
|
|
|
|
this.host.Dispose(); |
|
|
|
|
this.provider.Close(); |
|
|
|
|
|
|
|
|
|
FileService.FileRemoving -= FileServiceFileRemoving; |
|
|
|
|
base.Dispose(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|