private void HandleHostCalls(object sender, EventArgs eventArgs) { ObjectStream stream = sender as ObjectStream; if (stream != null) { Collection <object> collection = stream.NonBlockingRead(stream.Count); lock (this.SyncObject) { foreach (ClientMethodExecutor executor in collection) { base.Results.Add(new PSStreamObject(PSStreamObjectType.MethodExecutor, executor)); if (executor.RemoteHostCall.CallId != -100L) { base.SetJobState(JobState.Blocked, null); } } } } }