public bool TryConnect()
        {
            CheckIfDisposed();
            bool ReturnVal = NamedPipeWrapper.TryConnectToPipe(this.Name, this.Server, out this.Handle);

            return(ReturnVal);
        }
 protected void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         NamedPipeWrapper.Close(this.Handle);
     }
     disposed = true;
 }
 public override void Connect()
 {
     CheckIfDisposed();
     this.Handle = NamedPipeWrapper.ConnectToPipe(this.Name, this.Server);
 }
 public override void Close()
 {
     CheckIfDisposed();
     NamedPipeWrapper.Close(this.Handle);
 }
 public void WriteBytes(byte[] bytes)
 {
     CheckIfDisposed();
     NamedPipeWrapper.WriteBytes(Handle, bytes);
 }
 public void Write(string text)
 {
     CheckIfDisposed();
     NamedPipeWrapper.Write(Handle, text);
 }
 public byte[] ReadBytes()
 {
     CheckIfDisposed();
     return(NamedPipeWrapper.ReadBytes(Handle, maxReadBytes));
 }
 public string Read()
 {
     CheckIfDisposed();
     return(NamedPipeWrapper.Read(Handle, maxReadBytes));
 }