/// <summary> /// This terminates all conversations. /// </summary> /// <exception cref="InvalidOperationException"> /// This is thrown when the server is not registered. /// </exception> /// <exception cref="DdeException"> /// This is thrown when the conversations could not be terminated. /// </exception> public virtual void Disconnect() { ThreadStart method = delegate { DdemlObject.Disconnect(); }; try { Context.Invoke(method); } catch (DdemlException e) { throw new DdeException(e); } catch (ObjectDisposedException e) { throw new ObjectDisposedException(GetType().ToString(), e); } }
/// <overloads> /// <summary> /// </summary> /// </overloads> /// <summary> /// This terminates the specified conversation. /// </summary> /// <param name="conversation"> /// The conversation to terminate. /// </param> /// <exception cref="ArgumentNullException"> /// This is thrown when conversation is a null reference. /// </exception> /// <exception cref="InvalidOperationException"> /// This is thrown when the server is not registered. /// </exception> /// <exception cref="DdeException"> /// This is thrown when the conversation could not be terminated. /// </exception> public virtual void Disconnect(DdeConversation conversation) { ThreadStart method = delegate() { DdemlObject.Disconnect(conversation.DdemlObject); }; try { Context.Invoke(method); } catch (DdemlException e) { throw new DdeException(e); } catch (ArgumentException e) { throw e; } catch (ObjectDisposedException e) { throw new ObjectDisposedException(this.GetType().ToString(), e); } }