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


C# Process.StartApplication方法代码示例

本文整理汇总了C#中Process.StartApplication方法的典型用法代码示例。如果您正苦于以下问题:C# Process.StartApplication方法的具体用法?C# Process.StartApplication怎么用?C# Process.StartApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Process的用法示例。


在下文中一共展示了Process.StartApplication方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: engine_thread_main

        // <summary>
        //   The heart of the SingleSteppingEngine.  This runs in a background
        //   thread and processes stepping commands and events.
        //
        //   For each application we're debugging, there is just one SingleSteppingEngine,
        //   no matter how many threads the application has.  The engine is using one single
        //   event loop which is processing commands from the user and events from all of
        //   the application's threads.
        // </summary>
        void engine_thread_main()
        {
            Report.Debug (DebugFlags.Wait, "ThreadManager waiting");

            event_queue.Wait ();

            Report.Debug (DebugFlags.Wait, "ThreadManager done waiting");

            if (abort_requested) {
                Report.Debug (DebugFlags.Wait, "Engine thread abort requested");
                return;
            }

            int status;
            SingleSteppingEngine event_engine;
            Command command;

            Report.Debug (DebugFlags.Wait, "ThreadManager woke up: {0} {1:x} {2}",
                      current_event, current_event_status, current_command);

            event_engine = current_event;
            status = current_event_status;

            current_event = null;
            current_event_status = 0;

            command = current_command;
            current_command = null;

            if (event_engine != null) {
                try {
                    Report.Debug (DebugFlags.Wait,
                              "ThreadManager {0} process event: {1}",
                              DebuggerWaitHandle.CurrentThread, event_engine);
                    event_engine.ProcessEvent (status);
                    Report.Debug (DebugFlags.Wait,
                              "ThreadManager {0} process event done: {1}",
                              DebuggerWaitHandle.CurrentThread, event_engine);
                } catch (ST.ThreadAbortException) {
                    ;
                } catch (Exception e) {
                    Report.Debug (DebugFlags.Wait,
                              "ThreadManager caught exception: {0}", e);
                    Console.WriteLine ("EXCEPTION: {0}", e);
                }

                check_pending_events ();

                if (command == null)
                    engine_event.Set ();
                RequestWait ();
            }

            if (command == null)
                return;

            // These are synchronous commands; ie. the caller blocks on us
            // until we finished the command and sent the result.
            if (command.Type == CommandType.TargetAccess) {
                try {
                    if(command.Engine.Inferior != null)
                        command.Result = command.Engine.Invoke (
                            (TargetAccessDelegate) command.Data1, command.Data2);
                } catch (ST.ThreadAbortException) {
                    return;
                } catch (Exception ex) {
                    command.Result = ex;
                }

                check_pending_events ();

                engine_event.Set ();
            } else if (command.Type == CommandType.CreateProcess) {
                try {
                    ProcessStart start = (ProcessStart) command.Data1;
                    Process process = new Process (this, start);
                    processes.Add (process);

                    CommandResult result = process.StartApplication ();

                    RequestWait ();

                    command.Result = new KeyValuePair<CommandResult,Process> (result, process);
                } catch (ST.ThreadAbortException) {
                    return;
                } catch (Exception ex) {
                    command.Result = ex;
                }

                engine_event.Set ();
            } else {
//.........这里部分代码省略.........
开发者ID:baulig,项目名称:debugger,代码行数:101,代码来源:ThreadManager.cs


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