Ejemplo n.º 1
0
 private void ExecuteHostCall(RemoteHostCall hostcall)
 {
     if (hostcall.IsVoidMethod)
     {
         if (hostcall.IsSetShouldExitOrPopRunspace)
         {
             this.shell.ClearRemotePowerShell();
         }
         hostcall.ExecuteVoidMethod(this.hostToUse);
     }
     else
     {
         RemoteHostResponse hostResponse = hostcall.ExecuteNonVoidMethod(this.hostToUse);
         this.dataStructureHandler.SendHostResponseToServer(hostResponse);
     }
 }
Ejemplo n.º 2
0
 internal void HandleRemoteHostCalls(object sender, RemoteDataEventArgs <RemoteHostCall> eventArgs)
 {
     if (this.HostCallReceived != null)
     {
         this.HostCallReceived.SafeInvoke <RemoteDataEventArgs <RemoteHostCall> >(sender, eventArgs);
     }
     else
     {
         RemoteHostCall data = eventArgs.Data;
         if (data.IsVoidMethod)
         {
             data.ExecuteVoidMethod(base.host);
         }
         else
         {
             RemoteHostResponse hostResponse = data.ExecuteNonVoidMethod(base.host);
             this.dataStructureHandler.SendHostResponseToServer(hostResponse);
         }
     }
 }
 internal void HandleRemoteHostCalls(
     object sender,
     RemoteDataEventArgs <RemoteHostCall> eventArgs)
 {
     using (RemoteRunspacePoolInternal.tracer.TraceMethod())
     {
         if (this.HostCallReceived != null)
         {
             this.HostCallReceived(sender, eventArgs);
         }
         else
         {
             RemoteHostCall data = eventArgs.Data;
             if (data.IsVoidMethod)
             {
                 data.ExecuteVoidMethod(this.host);
             }
             else
             {
                 this.dataStructureHandler.SendHostResponseToServer(data.ExecuteNonVoidMethod(this.host));
             }
         }
     }
 }