Beispiel #1
0
        public override void EndDisconnect(IAsyncResult asyncResult)
        {
            if (asyncResult == null)
            {
                throw PSTraceSource.NewArgumentNullException("asyncResult");
            }
            RunspacePoolAsyncResult result = asyncResult as RunspacePoolAsyncResult;

            if (((result == null) || (result.OwnerId != base.instanceId)) || result.IsAssociatedWithAsyncOpen)
            {
                throw PSTraceSource.NewArgumentException("asyncResult", RunspacePoolInternal.resBaseName, "AsyncResultNotOwned", new object[] { "IAsyncResult", "BeginOpen" });
            }
            result.EndInvoke();
        }
        public void EndOpen(IAsyncResult asyncResult)
        {
            if (asyncResult == null)
            {
                throw PSTraceSource.NewArgumentNullException("asyncResult");
            }
            RunspacePoolAsyncResult result = asyncResult as RunspacePoolAsyncResult;

            if (((result == null) || (result.OwnerId != this.instanceId)) || !result.IsAssociatedWithAsyncOpen)
            {
                throw PSTraceSource.NewArgumentException("asyncResult", resBaseName, "AsyncResultNotOwned", new object[] { "IAsyncResult", "BeginOpen" });
            }
            result.EndInvoke();
        }