~ubuntu-branches/ubuntu/feisty/monodevelop/feisty

« back to all changes in this revision

Viewing changes to Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-08-18 00:51:23 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060818005123-5iit07y0j7wjg55f
Tags: 0.11+svn20060818-0ubuntu1
* New SVN snapshot
  + Works with Gtk# 2.9.0
* debian/control:
  + Updated Build-Depends
* debian/patches/use_nunit2.2.dpatch,
  debian/patches/use_real_libs.dpatch:
  + Updated
* debian/patches/versioncontrol_buildfix.dpatch:
  + Fix build failure in the version control addin

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
        public class ProcessService : AbstractService
18
18
        {
19
19
                ProcessHostController externalProcess;
20
 
                ExecutionHandlerCodon[] executionHandlers;
 
20
                ArrayList executionHandlers;
21
21
                string remotingChannel = "unix";
22
22
                string unixRemotingFile;
23
23
                
62
62
                        if (exited != null)
63
63
                                p.Exited += exited;
64
64
                                
65
 
                        if(arguments == null || arguments.Length == 0)
 
65
                        if(String.IsNullOrEmpty (arguments))
66
66
                                p.StartInfo = new ProcessStartInfo (command);
67
67
                        else
68
68
                                p.StartInfo = new ProcessStartInfo (command, arguments);
112
112
                
113
113
                public IExecutionHandler GetDefaultExecutionHandler (string platformId)
114
114
                {
115
 
                        if (executionHandlers == null)
116
 
                                executionHandlers = (ExecutionHandlerCodon[]) Runtime.AddInService.GetTreeItems ("/SharpDevelop/Workbench/ExecutionHandlers", typeof(ExecutionHandlerCodon));
 
115
                        if (executionHandlers == null) {
 
116
                                executionHandlers = new ArrayList ();
 
117
                                Runtime.AddInService.RegisterExtensionItemListener ("/SharpDevelop/Workbench/ExecutionHandlers", OnExtensionChange);
 
118
                        }
117
119
                        
118
120
                        foreach (ExecutionHandlerCodon codon in executionHandlers)
119
121
                                if (codon.Platform == platformId) return codon.ExecutionHandler;
120
122
                        return null;
121
123
                }
122
124
                
 
125
                void OnExtensionChange (ExtensionAction action, object item)
 
126
                {
 
127
                        if (action == ExtensionAction.Add)
 
128
                                executionHandlers.Add (item);
 
129
                }
 
130
                
123
131
                ProcessHostController GetHost (string id, bool shared)
124
132
                {
125
133
                        if (!shared)
140
148
                
141
149
                public RemoteProcessObject CreateExternalProcessObject (Type type, bool shared)
142
150
                {
143
 
                        return GetHost (type.ToString(), shared).CreateInstance (type.Assembly.Location, type.FullName);
144
 
                }
145
 
                
146
 
                public RemoteProcessObject CreateExternalProcessObject (string assemblyPath, string typeName, bool shared)
147
 
                {
148
 
                        return GetHost (typeName, shared).CreateInstance (assemblyPath, typeName);
 
151
                        return GetHost (type.ToString(), shared).CreateInstance (type.Assembly.Location, type.FullName, GetRequiredAddins (type));
 
152
                }
 
153
                
 
154
                public RemoteProcessObject CreateExternalProcessObject (string assemblyPath, string typeName, bool shared, params string[] requiredAddins)
 
155
                {
 
156
                        return GetHost (typeName, shared).CreateInstance (assemblyPath, typeName, requiredAddins);
 
157
                }
 
158
                
 
159
                string[] GetRequiredAddins (Type type)
 
160
                {
 
161
                        if (type.IsDefined (typeof(AddinDependencyAttribute), true)) {
 
162
                                object[] ats = type.GetCustomAttributes (typeof(AddinDependencyAttribute), true);
 
163
                                string[] addins = new string [ats.Length];
 
164
                                for (int n=0; n<ats.Length; n++)
 
165
                                        addins [n] = ((AddinDependencyAttribute)ats [n]).Addin;
 
166
                                return addins;
 
167
                        } else
 
168
                                return null;
149
169
                }
150
170
                
151
171
                public string ExternalProcessRemotingChannel {