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


C# ApartmentState.ToString方法代码示例

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


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

示例1: GetProcessStartInfo

        private ProcessStartInfo GetProcessStartInfo(ApartmentState state)
        {
            const string exeName = "RemoteScriptFactory.exe";

            // The exe is located in the IronStudio install dir. The repl can't run though unless IronPython and IronRuby dlls are GAC'd.
            string processBasePath = Path.GetDirectoryName(typeof(RemoteScriptFactory).Assembly.Location);

            #if DEBUG
            // While developing the tooling use an exe located in Bin\Debug as we don't GAC any dlls.
            string devBinPath = Environment.GetEnvironmentVariable("DLR_ROOT");
            if (devBinPath != null) {
                devBinPath = Path.Combine(devBinPath, @"Bin\Debug");
                if (File.Exists(Path.Combine(devBinPath, exeName))) {
                    processBasePath = devBinPath;
                }
            }
            #endif

            ProcessStartInfo processInfo = new ProcessStartInfo();
            processInfo.FileName = Path.Combine(processBasePath, exeName);
            processInfo.CreateNoWindow = true;

            // Set UseShellExecute to false to enable redirection.
            processInfo.UseShellExecute = false;

            // Redirect the standard streams. The output streams will be read asynchronously using an event handler.
            processInfo.RedirectStandardError = true;
            processInfo.RedirectStandardOutput = true;
            processInfo.RedirectStandardInput = true;
            processInfo.Arguments = state.ToString();

            return processInfo;
        }
开发者ID:TerabyteX,项目名称:main,代码行数:33,代码来源:RemoteScriptFactory.cs


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