diff --git a/src/AddIns/Misc/Profiler/Frontend/AddIn/AddIn.csproj b/src/AddIns/Misc/Profiler/Frontend/AddIn/AddIn.csproj index 09e47da3f7..142f3bf8df 100644 --- a/src/AddIns/Misc/Profiler/Frontend/AddIn/AddIn.csproj +++ b/src/AddIns/Misc/Profiler/Frontend/AddIn/AddIn.csproj @@ -71,6 +71,7 @@ Code + ProfilerView.xaml diff --git a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/FindCallsOfSelected.cs b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/FindCallsOfSelected.cs index 21befa5451..324e167324 100644 --- a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/FindCallsOfSelected.cs +++ b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/FindCallsOfSelected.cs @@ -30,9 +30,9 @@ namespace ICSharpCode.Profiler.AddIn.Commands /// public override void Run() { - var list = GetSelectedItems().ToList(); + var list = GetSelectedItems(); - if (list.Count > 0) { + if (list.Any()) { var items = from item in list select item.Node; List parts = new List(); @@ -44,7 +44,7 @@ namespace ICSharpCode.Profiler.AddIn.Commands } } - string header = "Results"; + string header = StringParser.Parse("${res:AddIns.Profiler.Commands.FindCallsOfSelected.TabTitle}"); Parent.CreateTab(header, "from c in Calls where " + string.Join(" || ", parts.ToArray()) + " select c"); } diff --git a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/RunTestWithProfilerCommand.cs b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/RunTestWithProfilerCommand.cs index b8311c45e5..719f74ee33 100644 --- a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/RunTestWithProfilerCommand.cs +++ b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/RunTestWithProfilerCommand.cs @@ -20,6 +20,8 @@ namespace ICSharpCode.Profiler.AddIn.Commands { public class RunTestWithProfilerCommand : AbstractRunTestCommand { + ProfilerRunner runner; + protected override void RunTests(UnitTestApplicationStartHelper helper) { TestRunnerCategory.AppendLine(helper.GetCommandLine()); @@ -32,7 +34,7 @@ namespace ICSharpCode.Profiler.AddIn.Commands startInfo.WorkingDirectory = UnitTestApplicationStartHelper.UnitTestApplicationDirectory; LoggingService.Info("starting profiler..."); - ProfilerRunner runner = new ProfilerRunner(startInfo, true, new ProfilingDataSQLiteWriter(path, true, GetUnitTestNames(helper).ToArray())); + runner = new ProfilerRunner(startInfo, true, new ProfilingDataSQLiteWriter(path, true, GetUnitTestNames(helper).ToArray())); runner.RunFinished += delegate { WorkbenchSingleton.SafeThreadCall(() => FileService.OpenFile(path)); @@ -72,22 +74,12 @@ namespace ICSharpCode.Profiler.AddIn.Commands LoggingService.Info("shutting profiler down..."); } - public override void Run() - { -// if (ProfilerService.IsProfilerLoaded && ProfilerService.CurrentProfiler.IsRunning) { -// MessageService.ShowError("Currently there is a profiling session in progress. " + -// "Please finish the current session before starting a new one."); -// } else { - base.Run(); -// } - } - protected override void OnStop() { -// if (ProfilerService.CurrentProfiler.IsRunning) { -// LoggingService.Info("stopping profiler..."); -// ProfilerService.CurrentProfiler.Stop(); -// } + if (this.runner != null && this.runner.Profiler.IsRunning) { + LoggingService.Info("stopping profiler..."); + runner.Stop(); + } } } } diff --git a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/SetAsRoot.cs b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/SetAsRoot.cs index 2572f364f4..b94de9adfe 100644 --- a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/SetAsRoot.cs +++ b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/SetAsRoot.cs @@ -44,9 +44,9 @@ namespace ICSharpCode.Profiler.AddIn.Commands parts.Add("GetNodeByPath(" + string.Join(",", path.Select(i => i.ToString()).ToArray()) + ")"); } - string header = "Merged Nodes: " + items.First().Name; + string header = string.Format(StringParser.Parse("${res:AddIns.Profiler.Commands.SetAsRoot.TabTitle}:"), items.First().Name); if (nameId == null) - header = "Merged Nodes"; + header = StringParser.Parse("${res:AddIns.Profiler.Commands.SetAsRoot.TabTitle}:"); Parent.CreateTab(header, "Merge(" + string.Join(",", parts.ToArray()) + ")"); } diff --git a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ShowFunctions.cs b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ShowFunctions.cs index ea2b8fd116..bd4973dfce 100644 --- a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ShowFunctions.cs +++ b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ShowFunctions.cs @@ -29,9 +29,8 @@ namespace ICSharpCode.Profiler.AddIn.Commands public override void Run() { var selectedItem = GetSelectedItems().FirstOrDefault(); - if (selectedItem != null) - Parent.CreateTab("All functions for " + selectedItem.GetSignature(), + Parent.CreateTab(string.Format(StringParser.Parse("${res:AddIns.Profiler.Commands.ShowFunctions.TabTitle}"), selectedItem.GetSignature()), "from f in Functions where f.Signature == \"" + selectedItem.GetSignature() + "\" select f"); } } diff --git a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml index b714a0eaa8..c4f4b5efa6 100644 --- a/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml +++ b/src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml @@ -1,11 +1,12 @@  - + @@ -13,24 +14,21 @@ - + - -Select the path of the executable you want to profile. -Optionally you can specify working directory and command line arguments to start the process. - - + +