private void Dispose(bool disposing) { if (!disposed) { try { thread.Abort(); } catch (ThreadStateException) { } using (NamedPipe p = new NamedPipe(Name)) p.Connect(); thread.Join(); base.Dispose(); } disposed = true; }