当前位置: 首页>>代码示例>>C#>>正文


C# Execution.ExecutionCommand类代码示例

本文整理汇总了C#中MonoDevelop.Core.Execution.ExecutionCommand的典型用法代码示例。如果您正苦于以下问题:C# ExecutionCommand类的具体用法?C# ExecutionCommand怎么用?C# ExecutionCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExecutionCommand类属于MonoDevelop.Core.Execution命名空间,在下文中一共展示了ExecutionCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CanDebugCommand

		public override bool CanDebugCommand (ExecutionCommand command)
		{
			NativeExecutionCommand cmd = command as NativeExecutionCommand;
			if (cmd == null)
				return false;
			
			string file = FindFile (cmd.Command);
			if (!File.Exists (file)) {
				// The provided file is not guaranteed to exist. If it doesn't
				// we assume we can execute it because otherwise the run command
				// in the IDE will be disabled, and that's not good because that
				// command will build the project if the exec doesn't yet exist.
				return true;
			}
			
			file = Path.GetFullPath (file);
			DateTime currentTime = File.GetLastWriteTime (file);
				
			FileData data;
			if (fileCheckCache.TryGetValue (file, out data)) {
				if (data.LastCheck == currentTime)
					return data.IsExe;
			}
			data.LastCheck = currentTime;
			try {
				data.IsExe = IsExecutable (file);
			} catch {
				data.IsExe = false;
			}
			fileCheckCache [file] = data;
			return data.IsExe;
		}
开发者ID:llucenic,项目名称:MonoDevelop.Debugger.Gdb.D,代码行数:32,代码来源:GdbSessionFactory.cs

示例2: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand c)
		{
			var cmd = (DotNetExecutionCommand) c;
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var dsi = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				Command = cmd.Command,
				Arguments = cmd.Arguments,
				WorkingDirectory = cmd.WorkingDirectory,
			};
			
			string error;
			dsi.UserAssemblyNames = GetAssemblyNames (cmd.UserAssemblyPaths, out error);
			dsi.LogMessage = error;
			
			foreach (KeyValuePair<string,string> var in cmd.EnvironmentVariables)
				dsi.EnvironmentVariables [var.Key] = var.Value;
			
			var varsCopy = new Dictionary<string, string> (cmd.EnvironmentVariables);
			dsi.ExternalConsoleLauncher = delegate (System.Diagnostics.ProcessStartInfo info) {
				IProcessAsyncOperation oper;
				oper = Runtime.ProcessService.StartConsoleProcess (info.FileName, info.Arguments, info.WorkingDirectory,
					varsCopy, ExternalConsoleFactory.Instance.CreateConsole (dsi.CloseExternalConsoleOnExit), null);
				return new ProcessAdapter (oper, Path.GetFileName (info.FileName));
			};

			return dsi;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:27,代码来源:SoftDebuggerEngine.cs

示例3: CreateDebuggerStartInfo

		public override DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand c)
		{
			var cmd = (DotNetExecutionCommand) c;
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var dsi = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				Command = cmd.Command,
				Arguments = cmd.Arguments,
				WorkingDirectory = cmd.WorkingDirectory,
			};
			
			SetUserAssemblyNames (dsi, cmd.UserAssemblyPaths);
			
			foreach (KeyValuePair<string,string> var in cmd.EnvironmentVariables)
				dsi.EnvironmentVariables [var.Key] = var.Value;
			
			var varsCopy = new Dictionary<string, string> (cmd.EnvironmentVariables);
			var startArgs = (SoftDebuggerLaunchArgs) dsi.StartArgs;
			startArgs.ExternalConsoleLauncher = delegate (System.Diagnostics.ProcessStartInfo info) {
				ProcessAsyncOperation oper;
				oper = Runtime.ProcessService.StartConsoleProcess (info.FileName, info.Arguments, info.WorkingDirectory,
					ExternalConsoleFactory.Instance.CreateConsole (dsi.CloseExternalConsoleOnExit), varsCopy);
				return new ProcessAdapter (oper, Path.GetFileName (info.FileName));
			};
			startArgs.MonoExecutableFileName = runtime.MonoRuntimeInfo.Force64or32bit.HasValue ? runtime.MonoRuntimeInfo.Force64or32bit.Value ? "mono64" : "mono32" : "mono";
			return dsi;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:26,代码来源:SoftDebuggerEngine.cs

示例4: Execute

		public IProcessAsyncOperation Execute (
			ExecutionCommand command,
			IConsole console)
		{
			var cmd = (TizenExecutionCommand) command;
			var config = cmd.Config;
			var sdkInfo = TizenSdkInfo.GetSdkInfo ();
			if (sdkInfo == null)
				return Finish (false);

			var project = config.ParentItem as Project;
			var tpkPath = FindTpkPath (project);
			if (tpkPath == null)
				return Finish (false);

			var sdkBuild = new TizenSdkBuild (config, sdkInfo);
			if (!sdkBuild.DoNativeInstall (tpkPath, console))
				return Finish (false);

			var tpkId = ExtractTpkId (tpkPath);
			if (tpkId == null)
				return Finish (false);

			var success = sdkBuild.DoNativeRun (tpkId, console);
			return Finish (success);
		}
开发者ID:kitsilanosoftware,项目名称:MonoDevelop.Tizen,代码行数:26,代码来源:TizenNativeExecutionHandler.cs

示例5: Execute

		public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
		{
			DotNetExecutionCommand cmd = (DotNetExecutionCommand) command;
			if (cmd.TargetRuntime == null)
				cmd.TargetRuntime = Runtime.SystemAssemblyService.DefaultRuntime;
			return cmd.TargetRuntime.GetExecutionHandler ().Execute (cmd, console);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:DotNetExecutionHandler.cs

示例6: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			DotNetExecutionCommand cmd = command as DotNetExecutionCommand;
			if (cmd != null) {
				DebuggerStartInfo startInfo = new DebuggerStartInfo ();
				startInfo.Command = cmd.Command;
				startInfo.Arguments = cmd.Arguments;
				startInfo.WorkingDirectory = cmd.WorkingDirectory;
				if (cmd.EnvironmentVariables.Count > 0) {
					foreach (KeyValuePair<string, string> val in cmd.EnvironmentVariables)
						startInfo.EnvironmentVariables[val.Key] = val.Value;
				}
				return startInfo;
			}
			AspNetExecutionCommand acmd = command as AspNetExecutionCommand;
			if (acmd != null) {
				DebuggerStartInfo startInfo = new DebuggerStartInfo ();
				string xspName = (acmd.ClrVersion == ClrVersion.Net_1_1) ? "xsp" : "xsp2";
				string xspPath = acmd.TargetRuntime.GetToolPath (acmd.TargetFramework, xspName);
				if (!File.Exists (xspPath))
					throw new UserException (string.Format ("The \"{0}\" web server cannot be started. Please ensure that it is installed.", xspName), null);

				startInfo.Command = xspPath;
				startInfo.Arguments = acmd.XspParameters.GetXspParameters () + " --nonstop";
				startInfo.WorkingDirectory = acmd.BaseDirectory;

				// Set DEVPATH when running on Windows (notice that this has no effect unless
				// <developmentMode developerInstallation="true" /> is set in xsp2.exe.config

				startInfo.EnvironmentVariables["DEVPATH"] = Path.GetDirectoryName (xspPath);
				return startInfo;
			}
			throw new NotSupportedException ();
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:34,代码来源:CorDebuggerEngine.cs

示例7: Execute

		public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
		{
			var cmd = (MonoDroidExecutionCommand) command;
			int runningProcessId = -1;

			var launchOp = new ChainedAsyncOperationSequence (
				new ChainedAsyncOperation<AdbGetProcessIdOperation> () {
					Create = () => new AdbGetProcessIdOperation (cmd.Device, cmd.PackageName),
					Completed = (op) => {
						if (op.Success)
							runningProcessId = op.ProcessId;
					}
				},
				new ChainedAsyncOperation () {
					Skip = () => runningProcessId <= 0 ? "" : null,
					Create = () => new AdbShellOperation (cmd.Device, "kill " + runningProcessId)
				},
				new ChainedAsyncOperation () {
					Create = () => MonoDroidFramework.Toolbox.StartActivity (cmd.Device, cmd.Activity)
				}
			);
			launchOp.Start ();

			return new MonoDroidProcess (cmd.Device, cmd.Activity, cmd.PackageName, 
				console.Out.Write, console.Error.Write, launchOp);
		}
开发者ID:sandyarmstrong,项目名称:monodevelop,代码行数:26,代码来源:MonoDroidExecutionHandler.cs

示例8: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			AspNetExecutionCommand cmd = (AspNetExecutionCommand) command;
			MonoDebuggerStartInfo startInfo = MonoDebuggerSessionFactory.CreateDebuggerStartInfo (cmd.TargetRuntime);
			
			string xspPath = Path.Combine (startInfo.MonoPrefix, "lib" + Path.DirectorySeparatorChar + "mono" + Path.DirectorySeparatorChar);
			
			if (cmd.ClrVersion == ClrVersion.Net_1_1)
				xspPath += Path.Combine ("1.0","xsp.exe");
			else
				xspPath += Path.Combine ("2.0","xsp2.exe");
			
			startInfo.IsXsp = true;
			startInfo.UserCodeOnly = true;
			startInfo.Command = xspPath;
			startInfo.WorkingDirectory = cmd.BaseDirectory;
			startInfo.Arguments = cmd.XspParameters.GetXspParameters ().Trim ();
			
			string binDir = Path.Combine (cmd.BaseDirectory, "bin");
			startInfo.UserModules = new List<string> ();
			foreach (string file in Directory.GetFiles (binDir)) {
				if (file.EndsWith (".dll") || file.EndsWith (".exe"))
					startInfo.UserModules.Add (file);
			}
			
			return startInfo;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:27,代码来源:MonoXspDebuggerSessionFactory.cs

示例9: CanExecute

		public bool CanExecute (ExecutionCommand command)
		{
			var cmd = command as MonoDroidExecutionCommand;
			if (cmd == null)
				return false;
			return true;
		}
开发者ID:carlosaml,项目名称:monodevelop,代码行数:7,代码来源:MonoDroidExecutionHandler.cs

示例10: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			var cmd = (AspNetExecutionCommand) command;
			
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var startInfo = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				WorkingDirectory = cmd.BaseDirectory,
				Arguments = cmd.XspParameters.GetXspParameters ().Trim (),
			};
			
			var xspName = AspNetExecutionHandler.GetXspName (cmd);
			
			FilePath fxDir = GetFxDir (runtime, cmd.ClrVersion);
			FilePath xspPath = fxDir.Combine (xspName).ChangeExtension (".exe");
			
			//no idea why xsp is sometimes relocated to a "winhack" dir on Windows
			if (MonoDevelop.Core.PropertyService.IsWindows && !File.Exists (xspPath)) {
				var winhack = fxDir.Combine ("winhack");
				if (Directory.Exists (winhack))
					xspPath = winhack.Combine (xspName).ChangeExtension (".exe");
			}
			
			if (!File.Exists (xspPath))
				throw new UserException (GettextCatalog.GetString (
					"The \"{0}\" web server cannot be started. Please ensure that it is installed.", xspName), null);
			
			startInfo.Command = xspPath;
			
			string error;
			startInfo.UserAssemblyNames = SoftDebuggerEngine.GetAssemblyNames (cmd.UserAssemblyPaths, out error);
			startInfo.LogMessage = error;
			
			return startInfo;
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:34,代码来源:AspNetSoftDebuggerEngine.cs

示例11: Execute

		public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
		{
			if (!CanExecute (command))
			    return null;
			DebugExecutionHandler h = new DebugExecutionHandler (null);
			return h.Execute (command, console);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:7,代码来源:DebugExecutionHandlerFactory.cs

示例12: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			var cmd = (AspNetExecutionCommand) command;
			
			var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
			var startInfo = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
				WorkingDirectory = cmd.BaseDirectory,
				Arguments = cmd.XspParameters.GetXspParameters ().Trim (),
			};
			
			FilePath prefix = runtime.Prefix;
			if (MonoDevelop.Core.PropertyService.IsWindows) {
				startInfo.Command = (cmd.ClrVersion == ClrVersion.Net_1_1)
					? prefix.Combine ("lib", "mono", "1.0", "winhack", "xsp.exe")
					: prefix.Combine ("lib", "mono", "2.0", "winhack", "xsp2.exe");
			}
			else {
				startInfo.Command = (cmd.ClrVersion == ClrVersion.Net_1_1)
					? prefix.Combine ("lib", "mono", "1.0", "xsp.exe")
					: prefix.Combine ("lib", "mono", "2.0", "xsp2.exe");
			}
			
			string error;
			startInfo.UserAssemblyNames = SoftDebuggerEngine.GetAssemblyNames (cmd.UserAssemblyPaths, out error);
			startInfo.LogMessage = error;
			
			return startInfo;
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:28,代码来源:AspNetSoftDebuggerEngine.cs

示例13: CreateDebuggerStartInfo

 public DebuggerStartInfo CreateDebuggerStartInfo(ExecutionCommand command)
 {
     var cmd = (MonobjcExecutionCommand) command;
     var startInfo = new MonobjcDebuggerStartInfo(IPAddress.Loopback, 46789, cmd);
     startInfo.SetUserAssemblies(cmd.UserAssemblyPaths);
     return startInfo;
 }
开发者ID:JeanAzzopardi,项目名称:monodevelop-monobjc,代码行数:7,代码来源:MonobjcSoftDebuggerEngine.cs

示例14: Execute

		public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
		{
			var cmd = (AspNetExecutionCommand) command;
			var xspPath = GetXspPath (cmd);
			
			//if it's a script, use a native execution handler
			if (xspPath.Extension != ".exe") {
				//set mono debug mode if project's in debug mode
				var envVars = cmd.TargetRuntime.GetToolsExecutionEnvironment (cmd.TargetFramework).Variables; 
				if (cmd.DebugMode) {
					envVars = new Dictionary<string, string> (envVars);
					envVars ["MONO_OPTIONS"] = "--debug";
				}
				
				var ncmd = new NativeExecutionCommand (
					xspPath, cmd.XspParameters.GetXspParameters () + " --nonstop",
					cmd.BaseDirectory, envVars);
				
				return Runtime.ProcessService.GetDefaultExecutionHandler (ncmd).Execute (ncmd, console);
			}

			// Set DEVPATH when running on Windows (notice that this has no effect unless
			// <developmentMode developerInstallation="true" /> is set in xsp2.exe.config

			var evars = cmd.TargetRuntime.GetToolsExecutionEnvironment (cmd.TargetFramework).Variables;
			if (cmd.TargetRuntime is MsNetTargetRuntime)
				evars["DEVPATH"] = Path.GetDirectoryName (xspPath);
			
			var netCmd = new DotNetExecutionCommand (
				xspPath, cmd.XspParameters.GetXspParameters () + " --nonstop",
				cmd.BaseDirectory, evars);
			netCmd.DebugMode = cmd.DebugMode;
			
			return cmd.TargetRuntime.GetExecutionHandler ().Execute (netCmd, console);
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:35,代码来源:AspNetExecutionHandler.cs

示例15: CreateDebuggerStartInfo

		public DebuggerStartInfo CreateDebuggerStartInfo (ExecutionCommand command)
		{
			var cmd = (MoonlightExecutionCommand) command;
			var msi = new MoonlightDebuggerStartInfo (cmd.AppName, cmd.Url);
			SoftDebuggerEngine.SetUserAssemblyNames (msi, cmd.UserAssemblyPaths);
			return msi;
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:7,代码来源:MoonlightSoftDebuggerEngine.cs


注:本文中的MonoDevelop.Core.Execution.ExecutionCommand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。