Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@novell.com>2009-03-04 19:22:29 +0300
committerLluis Sanchez <lluis@novell.com>2009-03-04 19:22:29 +0300
commit7bb2c7446ba4c2583db43f489897b1b8a25b1e8e (patch)
tree0a3199835f73e921cd1257d2545dc275c30b7528 /extras/MonoDevelop.Profiling
parentedcfb9b391c07aad2c35e24e34db79d240dd81be (diff)
Changed the way execution handlers work. We are not using platform
ids anymore. Instead, we use command strings when looking for execution handlers. IExecutionHandlerFactory has been removed and now everything is handled by IExecutionHandler, which has a new CanExecute method. This model is more simple and more generic. svn path=/trunk/monodevelop/; revision=128566
Diffstat (limited to 'extras/MonoDevelop.Profiling')
-rw-r--r--extras/MonoDevelop.Profiling/MonoDevelop.Profiling/AbstractProfiler.cs27
-rw-r--r--extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ChangeLog11
-rw-r--r--extras/MonoDevelop.Profiling/MonoDevelop.Profiling/IProfiler.cs4
-rw-r--r--extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ProfilingOperations.cs2
4 files changed, 28 insertions, 16 deletions
diff --git a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/AbstractProfiler.cs b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/AbstractProfiler.cs
index 8ef563632b..c12ca4ac07 100644
--- a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/AbstractProfiler.cs
+++ b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/AbstractProfiler.cs
@@ -73,12 +73,12 @@ namespace MonoDevelop.Profiling
get { return isSupported; }
}
- public virtual IExecutionHandlerFactory GetDefaultExecutionHandlerFactory ()
+ public virtual IExecutionHandler GetDefaultExecutionHandlerFactory ()
{
return new ApplicationExecutionHandlerFactory (this);
}
- public virtual IExecutionHandlerFactory GetProcessExecutionHandlerFactory (Process process)
+ public virtual IExecutionHandler GetProcessExecutionHandlerFactory (Process process)
{
return new ProcessExecutionHandlerFactory (this, process);
}
@@ -216,7 +216,7 @@ namespace MonoDevelop.Profiling
return null;
}
- protected internal class ApplicationExecutionHandlerFactory : IExecutionHandlerFactory
+ protected internal class ApplicationExecutionHandlerFactory : IExecutionHandler
{
IProfiler profiler;
@@ -225,20 +225,20 @@ namespace MonoDevelop.Profiling
this.profiler = profiler;
}
- public bool SupportsPlatform (string platformId)
+ public bool CanExecute (string command)
{
- return platformId == "Mono";
+ string ext = System.IO.Path.GetExtension (command).ToLower ();
+ return ext == ".exe" || ext == ".dll";
}
- public IExecutionHandler CreateExecutionHandler (string platformId)
+ public IProcessAsyncOperation Execute (string command, string arguments, string workingDirectory, IDictionary<string, string> environmentVariables, IConsole console)
{
- if (platformId == "Mono")
- return new MonoProfilerExecutionHandler (profiler);
- return null;
+ MonoProfilerExecutionHandler h = new MonoProfilerExecutionHandler (profiler);
+ return h.Execute (command, arguments, workingDirectory, environmentVariables, console);
}
}
- protected internal class ProcessExecutionHandlerFactory : IExecutionHandlerFactory
+ protected internal class ProcessExecutionHandlerFactory : IExecutionHandler
{
IProfiler profiler;
Process process;
@@ -249,14 +249,15 @@ namespace MonoDevelop.Profiling
this.process = process;
}
- public bool SupportsPlatform (string platformId)
+ public bool CanExecute (string command)
{
return true;
}
- public IExecutionHandler CreateExecutionHandler (string platformId)
+ public IProcessAsyncOperation Execute (string command, string arguments, string workingDirectory, IDictionary<string, string> environmentVariables, IConsole console)
{
- return new ProcessProfilerExecutionHandler (profiler, process);
+ ProcessProfilerExecutionHandler h = new ProcessProfilerExecutionHandler (profiler, process);
+ return h.Execute (command, arguments, workingDirectory, environmentVariables, console);
}
}
}
diff --git a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ChangeLog b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ChangeLog
index aa775975e2..5fa77e269a 100644
--- a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ChangeLog
+++ b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ChangeLog
@@ -1,3 +1,14 @@
+2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
+
+ * IProfiler.cs:
+ * AbstractProfiler.cs:
+ * ProfilingOperations.cs: Changed the way execution handlers
+ work. We are not using platform ids anymore. Instead, we use
+ command strings when looking for execution handlers.
+ IExecutionHandlerFactory has been removed and now everything
+ is handled by IExecutionHandler, which has a new CanExecute
+ method. This model is more simple and more generic.
+
2009/02/03 Lluis Sanchez Gual <lluis@novell.com>
* AssemblyInfo.cs:
diff --git a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/IProfiler.cs b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/IProfiler.cs
index 1153b7fe29..88ff0aa723 100644
--- a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/IProfiler.cs
+++ b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/IProfiler.cs
@@ -41,8 +41,8 @@ namespace MonoDevelop.Profiling
string GetSnapshotFileName (string workingDirectory, string filename);
- IExecutionHandlerFactory GetDefaultExecutionHandlerFactory ();
- IExecutionHandlerFactory GetProcessExecutionHandlerFactory (Process process);
+ IExecutionHandler GetDefaultExecutionHandlerFactory ();
+ IExecutionHandler GetProcessExecutionHandlerFactory (Process process);
event ProfilingSnapshotEventHandler SnapshotTaken;
event EventHandler SnapshotFailed;
diff --git a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ProfilingOperations.cs b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ProfilingOperations.cs
index 7024f81f36..8cc0fe16f3 100644
--- a/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ProfilingOperations.cs
+++ b/extras/MonoDevelop.Profiling/MonoDevelop.Profiling/ProfilingOperations.cs
@@ -90,7 +90,7 @@ namespace MonoDevelop.Profiling
SwitchWorkbenchContext (ProfileWorkbenchContext);
string workingDir = ProfilingService.GetProcessDirectory (process.Id);
- IExecutionHandler handler = profiler.GetProcessExecutionHandlerFactory (process).CreateExecutionHandler (null);
+ IExecutionHandler handler = profiler.GetProcessExecutionHandlerFactory (process);
return handler.Execute (null, null, workingDir, null, null /*context.ConsoleFactory.CreateConsole (true)*/);
}