Browse Source

added work-around for Windows Forms bug in ElementHost, because WpfViewer was sometimes not displayed.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3949 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 17 years ago
parent
commit
bfd65e84a8
  1. 11
      src/AddIns/Misc/Profiler/Controller/Data/CallTreeNode.cs
  2. 2
      src/AddIns/Misc/Profiler/Controller/Data/ProfilingDataSQLiteWriter.cs
  3. 8
      src/AddIns/Misc/Profiler/Controller/Data/SQLiteCallTreeNode.cs
  4. 4
      src/AddIns/Misc/Profiler/Controller/Data/UnmanagedCallTreeNode.cs
  5. 2
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ProfileProject.cs
  6. 2
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs
  7. 10
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Views/WpfViewer.cs
  8. 1
      src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

11
src/AddIns/Misc/Profiler/Controller/Data/CallTreeNode.cs

@ -49,7 +49,16 @@ namespace ICSharpCode.Profiler.Controller.Data @@ -49,7 +49,16 @@ namespace ICSharpCode.Profiler.Controller.Data
/// <summary>
/// Gets the number of calls to the method represented by the CallTreeNode.
/// </summary>
public abstract int CallCount { get; }
public abstract int RawCallCount { get; }
/// <summary>
/// Gets the number of calls to the method represented by the CallTreeNode.
/// </summary>
public virtual int CallCount {
get {
return this.RawCallCount + (this.IsActiveAtStart ? 1 : 0);
}
}
/// <summary>
/// Gets whether the function call started in a previous data set that's not selected.

2
src/AddIns/Misc/Profiler/Controller/Data/ProfilingDataSQLiteWriter.cs

@ -190,7 +190,7 @@ namespace ICSharpCode.Profiler.Controller.Data @@ -190,7 +190,7 @@ namespace ICSharpCode.Profiler.Controller.Data
throw new InvalidOperationException("Too large CpuCyclesSpent - there's something wrong in the data");
}
dataParams.callCount.Value = node.CallCount;
dataParams.callCount.Value = node.RawCallCount;
dataParams.isActiveAtStart.Value = node.IsActiveAtStart;
dataParams.cpuCyclesSpent.Value = node.CpuCyclesSpent;
dataParams.dataSetId.Value = dataSetCount;

8
src/AddIns/Misc/Profiler/Controller/Data/SQLiteCallTreeNode.cs

@ -46,12 +46,10 @@ namespace ICSharpCode.Profiler.Controller.Data @@ -46,12 +46,10 @@ namespace ICSharpCode.Profiler.Controller.Data
}
}
/// <summary>
/// Gets the number of calls to the method represented by the CallTreeNode.
/// </summary>
public override int CallCount {
/// <inheritdoc/>
public override int RawCallCount {
get {
return this.callCount + (isActiveAtStart ? 1 : 0);
return this.callCount;
}
}

4
src/AddIns/Misc/Profiler/Controller/Data/UnmanagedCallTreeNode.cs

@ -55,10 +55,10 @@ namespace ICSharpCode.Profiler.Controller.Data @@ -55,10 +55,10 @@ namespace ICSharpCode.Profiler.Controller.Data
}
}
public override int CallCount {
public override int RawCallCount {
get {
dataSet.VerifyAccess(); // need to verify before deferencing data
return this.data->CallCount + (IsActiveAtStart ? 1 : 0);
return this.data->CallCount;
}
}

2
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ProfileProject.cs

@ -58,7 +58,7 @@ namespace ICSharpCode.Profiler.AddIn.Commands @@ -58,7 +58,7 @@ namespace ICSharpCode.Profiler.AddIn.Commands
currentProj.Save();
};
WorkbenchSingleton.CallLater(20, updater);
WorkbenchSingleton.SafeThreadCall(updater);
};
}

2
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs

@ -49,7 +49,7 @@ namespace ICSharpCode.Profiler.AddIn.Dialogs @@ -49,7 +49,7 @@ namespace ICSharpCode.Profiler.AddIn.Dialogs
runner.RunFinished += delegate {
string title = Path.GetFileName(outputPath);
ProfilingDataProvider provider = new ProfilingDataSQLiteProvider(outputPath);
WorkbenchSingleton.CallLater(20, () => WorkbenchSingleton.Workbench.ShowView(new WpfViewer(provider, title)));
WorkbenchSingleton.SafeThreadCall(() => WorkbenchSingleton.Workbench.ShowView(new WpfViewer(provider, title)));
};
runner.Run();

10
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Views/WpfViewer.cs

@ -44,7 +44,13 @@ namespace ICSharpCode.Profiler.AddIn.Views @@ -44,7 +44,13 @@ namespace ICSharpCode.Profiler.AddIn.Views
this.TabPageText = title;
this.TitleName = this.TabPageText;
this.host = new SharpDevelopElementHost(dataView = new ProfilerView(this.provider));
this.host.Dock = DockStyle.Fill;
// HACK : Make host.Child visible
WorkbenchSingleton.SafeThreadAsyncCall(
() => {
this.host.Dock = DockStyle.None;
this.host.Dock = DockStyle.Fill;
}
);
}
/// <summary>
@ -66,5 +72,5 @@ namespace ICSharpCode.Profiler.AddIn.Views @@ -66,5 +72,5 @@ namespace ICSharpCode.Profiler.AddIn.Views
this.provider.Close();
base.Dispose();
}
}
}
}

1
src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

@ -106,6 +106,7 @@ namespace ICSharpCode.Profiler.Controls @@ -106,6 +106,7 @@ namespace ICSharpCode.Profiler.Controls
this.RangeEnd = end;
this.searchRoot = new CallTreeNodeViewModel(this.Provider.GetRoot(start, end), null);
this.Invalidate();
this.InvalidateArrange();
}
public void Invalidate()

Loading…
Cancel
Save