Esempio n. 1
0
        /// <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);
            }
        }
Esempio n. 2
0
 /// <overloads>
 /// <summary>
 /// </summary>
 /// </overloads>
 /// <summary>
 /// This is invoked when a client attempts to request data.
 /// </summary>
 /// <param name="conversation">
 /// The conversation associated with this event.
 /// </param>
 /// <param name="item">
 /// The item name associated with this event.
 /// </param>
 /// <param name="format">
 /// The format of the data.
 /// </param>
 /// <returns>
 /// A <c>RequestResult</c> indicating the result.
 /// </returns>
 /// <remarks>
 /// The default implementation returns <c>RequestResult.NotProcessed</c> to the client.
 /// </remarks>
 protected virtual RequestResult OnRequest(DdeConversation conversation, string item, int format)
 {
     return RequestResult.NotProcessed;
 }
Esempio n. 3
0
 /// <summary>
 /// This is invoked when a client sends data.
 /// </summary>
 /// <param name="conversation">
 /// The conversation associated with this event.
 /// </param>
 /// <param name="item">
 /// The item name associated with this event.
 /// </param>
 /// <param name="data">
 /// The data associated with this event.
 /// </param>
 /// <param name="format">
 /// The format of the data.
 /// </param>
 /// <returns>
 /// A <c>PokeResult</c> indicating the result.
 /// </returns>
 /// <remarks>
 /// The default implementation returns <c>PokeResult.NotProcessed</c> to the client.
 /// </remarks>
 protected virtual PokeResult OnPoke(DdeConversation conversation, string item, byte[] data, int format)
 {
     return PokeResult.NotProcessed;
 }
Esempio n. 4
0
 /// <summary>
 /// This is invoked when a client sends a command.
 /// </summary>
 /// <param name="conversation">
 /// The conversation associated with this event.
 /// </param>
 /// <param name="command">
 /// The command to be executed.
 /// </param>
 /// <returns>
 /// An <c>ExecuteResult</c> indicating the result.
 /// </returns>
 /// <remarks>
 /// The default implementation returns <c>ExecuteResult.NotProcessed</c> to the client.
 /// </remarks>
 protected virtual ExecuteResult OnExecute(DdeConversation conversation, string command)
 {
     return ExecuteResult.NotProcessed;
 }
Esempio n. 5
0
 /// <summary>
 /// This is invoked when a client terminates a conversation.
 /// </summary>
 /// <param name="conversation">
 /// The conversation associated with this event.
 /// </param>
 protected virtual void OnDisconnect(DdeConversation conversation)
 {
 }
Esempio n. 6
0
 /// <summary>
 /// This is invoked when a client has successfully established a conversation.
 /// </summary>
 /// <param name="conversation">
 /// The conversation associated with this event.
 /// </param>
 protected virtual void OnAfterConnect(DdeConversation conversation)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// This is invoked when a client terminates an advise loop.
 /// </summary>
 /// <param name="conversation">
 /// The conversation associated with this event.
 /// </param>
 /// <param name="item">
 /// The item name associated with this event.
 /// </param>
 protected virtual void OnStopAdvise(DdeConversation conversation, string item)
 {
 }
Esempio n. 8
0
 /// <summary>
 /// This is invoked when a client attempts to initiate an advise loop.
 /// </summary>
 /// <param name="conversation">
 /// The conversation associated with this event.
 /// </param>
 /// <param name="item">
 /// The item name associated with this event.
 /// </param>
 /// <param name="format">
 /// The format of the data.
 /// </param>
 /// <returns>
 /// True to allow the advise loop, false otherwise.
 /// </returns>
 /// <remarks>
 /// The default implementation accepts all advise loops.
 /// </remarks>
 protected virtual bool OnStartAdvise(DdeConversation conversation, string item, int format)
 {
     return true;
 }
Esempio n. 9
0
 protected override void OnAfterConnect(DdemlConversation conversation)
 {
     DdeConversation c = new DdeConversation(conversation);
     conversation.Tag = c;
     _Parent.OnAfterConnect(c);
 }