當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。