Microsoft.Protocols.TestSuites.Common.OxcropsClient.Disconnect C# (CSharp) Method

Disconnect() public method

Disconnect from the server.
public Disconnect ( ) : bool
return bool
        public bool Disconnect()
        {
            uint ret = 0;

            this.privateMailboxServer = null;
            this.privateMailboxProxyServer = null;

            this.publicFolderServer = null;
            this.publicFolderProxyServer = null;

            this.privateMailStoreUrl = null;
            this.publicFolderUrl = null;

            if (this.IsConnected)
            {
                switch (this.MapiContext.TransportSequence.ToLower())
                {
                    case "mapi_http":
                        ret = this.mapiHttpAdapter.Disconnect();
                        break;
                    case "ncacn_ip_tcp":
                    case "ncacn_http":
                        ret = this.rpcAdapter.Disconnect(ref this.cxh);
                        break;
                    default:
                        this.site.Assert.Fail("TransportSeq \"{0}\" is not supported by the test suite.");
                        break;
                }

                if (ret == 0)
                {
                    this.IsConnected = false;
                }
                else
                {
                    return false;
                }
            }

            return true;
        }