Наследование: MonoDevelop.Ide.Gui.AbstractViewContent
Пример #1
0
        public override IProcessAsyncOperation Execute(ExecutionCommand command, IConsole console, CommandExecutionContext ctx, object config_data)
        {
            DotNetExecutionCommand dnec = command as DotNetExecutionCommand;

            ProfileConfiguration config = new ProfileConfiguration ();
            config.TargetPath = command.CommandString;
            ProfilerExecutionOptions options = config_data as ProfilerExecutionOptions;
            if (options != null) {
                config.StartEnabled = options.StartEnabled;
                config.Mode = options.Mode;
            }

            string logfile = System.IO.Path.GetTempFileName () + ".mprof";
            ProfilerSocket socket = new ProfilerSocket ();
            ProfilerViewContent view = new ProfilerViewContent ();
            socket.Paused += delegate { view.Load (logfile); };
            dnec.RuntimeArguments += String.Format (" --profile=logging:{0},o={1},cp={2}", config.ToArgs (), logfile, socket.Port);
            IExecutionHandler h = Runtime.ProcessService.GetDefaultExecutionHandler (command);
            IProcessAsyncOperation result = h.Execute (command, console);
            result.Completed += delegate { view.Load (logfile); };
            Gtk.Application.Invoke (delegate { IdeApp.Workbench.OpenDocument (view, true); });
            return result;
        }
Пример #2
0
 public override IViewContent CreateContentForUri(string filename)
 {
     ProfilerViewContent view = new ProfilerViewContent ();
     return view;
 }