示例#1
0
        /// <summary>
        ///     This pauses 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 paused.
        /// </exception>
        /// <remarks>
        ///     Pausing a conversation causes this object to queue events until the conversation resumes.
        /// </remarks>
        public virtual void Pause()
        {
            ThreadStart method = delegate { DdemlObject.Pause(); };

            try
            {
                Context.Invoke(method);
            }
            catch (DdemlException e)
            {
                throw new DdeException(e);
            }
            catch (ObjectDisposedException e)
            {
                throw new ObjectDisposedException(GetType().ToString(), e);
            }
        }
示例#2
0
        /// <overloads>
        /// <summary>
        /// </summary>
        /// <remarks>
        /// Pausing a conversation causes this server to queue events until the conversation resumes.
        /// </remarks>
        /// </overloads>
        /// <summary>
        /// This pauses the specified conversation.
        /// </summary>
        /// <param name="conversation">
        /// The conversation to pause.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// This is thrown when conversation is a null reference.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// This is thrown when the conversation is already paused or when the server is not registered.
        /// </exception>
        /// <exception cref="DdeException">
        /// This is thrown when the conversation could not be paused.
        /// </exception>
        public virtual void Pause(DdeConversation conversation)
        {
            ThreadStart method = delegate()
            {
                DdemlObject.Pause(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);
            }
        }