public virtual void Disconnect()
        {
            if (IsDisposed)
                throw new ObjectDisposedException(GetType().ToString());
            if (!IsRegistered)
                throw new InvalidOperationException(Resources.NotRegisteredMessage);

            // Terminate all conversations.
            foreach (var conversation in _ConversationTable.Values)
                Ddeml.DdeDisconnect(conversation.Handle);

            // clear the conversation table.
            _ConversationTable.Clear();
        }
        public virtual void Disconnect(DdemlConversation conversation)
        {
            if (IsDisposed)
                throw new ObjectDisposedException(GetType().ToString());
            if (!IsRegistered)
                throw new InvalidOperationException(Resources.NotRegisteredMessage);
            if (conversation == null)
                throw new ArgumentNullException(nameof(conversation));

            if (!_ConversationTable.ContainsKey(conversation.Handle)) return;
            // Terminate the conversation.
            Ddeml.DdeDisconnect(conversation.Handle);

            // Remove the Conversation from the conversation table.
            _ConversationTable.Remove(conversation.Handle);
        }
Ejemplo n.º 3
0
        public virtual void Disconnect()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.GetType().ToString());
            }
            if (!IsRegistered)
            {
                throw new InvalidOperationException(DDE.NotRegisteredMessage);
            }

            // Terminate all conversations.
            foreach (DdemlConversation conversation in _ConversationTable.Values)
            {
                Ddeml.DdeDisconnect(conversation.Handle);
            }

            // clear the conversation table.
            _ConversationTable.Clear();
        }
Ejemplo n.º 4
0
        public virtual void Disconnect(DdemlConversation conversation)
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.GetType().ToString());
            }
            if (!IsRegistered)
            {
                throw new InvalidOperationException(DDE.NotRegisteredMessage);
            }
            if (conversation == null)
            {
                throw new ArgumentNullException("conversation");
            }
            
            if (_ConversationTable.ContainsKey(conversation.Handle))
            {
                // Terminate the conversation.
                Ddeml.DdeDisconnect(conversation.Handle);

                // Remove the Conversation from the conversation table.
                _ConversationTable.Remove(conversation.Handle);
            }
        }