protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // release managed resources.
                if (null != this.customRpc)
                {
                    try
                    {
                        this.customRpc.Unbind();
                    }
                    catch
                    {
                        // ignore the exception thrown by Unbind method.
                    }

                    this.customRpc.Dispose();
                    this.customRpc = null;
                }
            }

            // release unmanaged resources.
        }
 /// <summary>
 /// Initializes a new instance of the NrpcCustomClient class.
 /// </summary>
 /// <param name="domainName">Domain name.</param>
 public NrpcCustomClient(string domainName)
 {
     this.context            = new NrpcCustomClientContext();
     this.customRpc          = new NrpcCustomRpcAdapter();
     this.context.DomainName = domainName;
 }