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


C# Runspace.OpenAsync方法代码示例

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


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

示例1: PushRunspace

 public void PushRunspace(Runspace runspace)
 {
     Runspaces.Push(runspace);
     if (runspace.RunspaceAvailability != RunspaceAvailability.Available) runspace.OpenAsync();
 }
开发者ID:caindy,项目名称:psash,代码行数:5,代码来源:PSashHost.cs

示例2: OpenAsync

        internal void OpenAsync()
        {
            // Always create runspace with WSManConnectionInfo.EnableNetworkAccess set to true.
            WSManConnectionInfo copyConnectionInfo = ConnectionInfo.Copy();
            copyConnectionInfo.EnableNetworkAccess = true;

            // If the remote runspace is not available after crash/shutdown, 
            // activity task resume will fall back to reexecuting in a new runspace is assigned for the connection
            if (!CheckAndReconnectAfterCrashOrShutdown(copyConnectionInfo))
            {
                _runspace = RunspaceFactory.CreateRunspace(copyConnectionInfo, null, LocalRunspaceProvider.SharedTypeTable);
                _runspace.StateChanged += RunspaceStateChanged;
                _tracer.WriteMessage("PSW Conn: Calling OpenAsync on runspace");
                _runspace.OpenAsync();
            }
        }
开发者ID:40a,项目名称:PowerShell,代码行数:16,代码来源:ConnectionManager.cs

示例3: DynamicPowershell

 public DynamicPowershell() {
     _runspace = RunspaceFactory.CreateRunspace();
     if(_runspace.RunspaceStateInfo.State == RunspaceState.BeforeOpen) {
         _runspace.OpenAsync();
     }
     _runspaceIsOwned = true;
 }
开发者ID:roomaroo,项目名称:coapp.powershell,代码行数:7,代码来源:DynamicPowershell.cs


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