public CloseAsyncResult(WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator parent, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
                {
                    this.parent               = parent;
                    this.timeoutHelper        = new TimeoutHelper(timeout);
                    this.onBaseClose          = Fx.ThunkCallback(new AsyncCallback(this.OnBaseClose));
                    this.onCloseTokenProvider = Fx.ThunkCallback(new AsyncCallback(this.OnCloseTokenProvider));
                    IAsyncResult result = parent.BaseBeginClose(this.timeoutHelper.RemainingTime(), this.onBaseClose, this);

                    if (result.CompletedSynchronously && this.HandleBaseCloseComplete(result))
                    {
                        base.Complete(true);
                    }
                }
                public OpenAsyncResult(WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator parent, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
                {
                    this.parent = parent;
                    TimeoutHelper helper = new TimeoutHelper(timeout);

                    this.onBaseOpen          = Fx.ThunkCallback(new AsyncCallback(this.OnBaseOpen));
                    this.onGetSspiCredential = Fx.ThunkCallback(new AsyncCallback(this.OnGetSspiCredential));
                    this.onOpenTokenProvider = Fx.ThunkCallback(new AsyncCallback(this.OnOpenTokenProvider));
                    IAsyncResult result = parent.BaseBeginOpen(helper.RemainingTime(), this.onBaseOpen, this);

                    if (result.CompletedSynchronously && this.HandleBaseOpenComplete(result))
                    {
                        base.Complete(true);
                    }
                }
 public InitiateUpgradeAsyncResult(WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator initiator, AsyncCallback callback, object state) : base(callback, state)
 {
     this.initiator = initiator;
 }
 public OpenAsyncResult(WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator parent, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.parent = parent;
     TimeoutHelper helper = new TimeoutHelper(timeout);
     this.onBaseOpen = Fx.ThunkCallback(new AsyncCallback(this.OnBaseOpen));
     this.onGetSspiCredential = Fx.ThunkCallback(new AsyncCallback(this.OnGetSspiCredential));
     this.onOpenTokenProvider = Fx.ThunkCallback(new AsyncCallback(this.OnOpenTokenProvider));
     IAsyncResult result = parent.BaseBeginOpen(helper.RemainingTime(), this.onBaseOpen, this);
     if (result.CompletedSynchronously && this.HandleBaseOpenComplete(result))
     {
         base.Complete(true);
     }
 }
 public InitiateUpgradeAsyncResult(WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator initiator, AsyncCallback callback, object state) : base(callback, state)
 {
     this.initiator = initiator;
 }
 public CloseAsyncResult(WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator parent, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
 {
     this.parent = parent;
     this.timeoutHelper = new TimeoutHelper(timeout);
     this.onBaseClose = Fx.ThunkCallback(new AsyncCallback(this.OnBaseClose));
     this.onCloseTokenProvider = Fx.ThunkCallback(new AsyncCallback(this.OnCloseTokenProvider));
     IAsyncResult result = parent.BaseBeginClose(this.timeoutHelper.RemainingTime(), this.onBaseClose, this);
     if (result.CompletedSynchronously && this.HandleBaseCloseComplete(result))
     {
         base.Complete(true);
     }
 }