Exemplo n.º 1
0
 internal PSRemotingJob(PSSession[] remoteRunspaceInfos, List <IThrottleOperation> runspaceHelpers, string remoteCommand, int throttleLimit, string name) : base(remoteCommand, name)
 {
     this.moreData         = true;
     this.hideComputerName = true;
     this.throttleManager  = new ThrottleManager();
     this._syncObject      = new object();
     for (int i = 0; i < remoteRunspaceInfos.Length; i++)
     {
         ExecutionCmdletHelperRunspace helper = (ExecutionCmdletHelperRunspace)runspaceHelpers[i];
         PSRemotingChildJob            item   = new PSRemotingChildJob(remoteCommand, helper, this.throttleManager);
         item.StateChanged += new EventHandler <JobStateEventArgs>(this.HandleChildJobStateChanged);
         item.JobUnblocked += new EventHandler(this.HandleJobUnblocked);
         base.ChildJobs.Add(item);
     }
     this.CommonInit(throttleLimit, runspaceHelpers);
 }
Exemplo n.º 2
0
 internal PSRemotingJob(
     PSSession[] remoteRunspaceInfos,
     List <IThrottleOperation> runspaceHelpers,
     string remoteCommand,
     int throttleLimit,
     string name)
     : base(remoteCommand, name)
 {
     using (PSRemotingJob.tracer.TraceConstructor((object)this))
     {
         for (int index = 0; index < remoteRunspaceInfos.Length; ++index)
         {
             ExecutionCmdletHelperRunspace runspaceHelper   = (ExecutionCmdletHelperRunspace)runspaceHelpers[index];
             PSRemotingChildJob            remotingChildJob = new PSRemotingChildJob(remoteCommand, (ExecutionCmdletHelper)runspaceHelper, this.throttleManager);
             remotingChildJob.StateChanged += new EventHandler <JobStateEventArgs>(this.HandleChildJobStateChanged);
             remotingChildJob.JobUnblocked += new EventHandler(this.HandleJobUnblocked);
             this.ChildJobs.Add((Job)remotingChildJob);
         }
         this.CommonInit(throttleLimit, runspaceHelpers);
     }
 }