internal DdeConversation(DdemlConversation conversation)
 {
     _DdemlObject = conversation;
     _DdemlObject.StateChange += this.OnStateChange;
     _Service = _DdemlObject.Service;
     _Topic = _DdemlObject.Topic;
     _Handle = _DdemlObject.Handle;
     _IsPaused = _DdemlObject.IsPaused;
 }
예제 #2
0
 protected override RequestResult OnRequest(DdemlConversation conversation, string item, int format)
 {
     DdeServer.RequestResult result = _Parent.OnRequest((DdeConversation)conversation.Tag, item, format);
     if (result == DdeServer.RequestResult.NotProcessed)
     {
         return RequestResult.NotProcessed;
     }
     if (result == DdeServer.RequestResult.PauseConversation)
     {
         return RequestResult.PauseConversation;
     }
     if (result == DdeServer.RequestResult.Processed)
     {
         return new RequestResult(result.Data);
     }
     return RequestResult.NotProcessed;
 }
예제 #3
0
 protected override PokeResult OnPoke(DdemlConversation conversation, string item, byte[] data, int format)
 {
     DdeServer.PokeResult result = _Parent.OnPoke((DdeConversation)conversation.Tag, item, data, format);
     if (result == DdeServer.PokeResult.NotProcessed)
     {
         return PokeResult.NotProcessed;
     }
     if (result == DdeServer.PokeResult.PauseConversation)
     {
         return PokeResult.PauseConversation;
     }
     if (result == DdeServer.PokeResult.Processed)
     {
         return PokeResult.Processed;
     }
     if (result == DdeServer.PokeResult.TooBusy)
     {
         return PokeResult.TooBusy;
     }
     return PokeResult.NotProcessed;
 }
예제 #4
0
 protected override ExecuteResult OnExecute(DdemlConversation conversation, string command)
 {
     DdeServer.ExecuteResult result = _Parent.OnExecute((DdeConversation)conversation.Tag, command);
     if (result == DdeServer.ExecuteResult.NotProcessed)
     {
         return ExecuteResult.NotProcessed;
     }
     if (result == DdeServer.ExecuteResult.PauseConversation)
     {
         return ExecuteResult.PauseConversation;
     }
     if (result == DdeServer.ExecuteResult.Processed)
     {
         return ExecuteResult.Processed;
     }
     if (result == DdeServer.ExecuteResult.TooBusy)
     {
         return ExecuteResult.TooBusy;
     }
     return ExecuteResult.NotProcessed;
 }
예제 #5
0
 protected override void OnDisconnect(DdemlConversation conversation)
 {
     _Parent.OnDisconnect((DdeConversation)conversation.Tag);
 }
예제 #6
0
 protected override void OnAfterConnect(DdemlConversation conversation)
 {
     DdeConversation c = new DdeConversation(conversation);
     conversation.Tag = c;
     _Parent.OnAfterConnect(c);
 }
예제 #7
0
 protected virtual void OnStopAdvise(DdemlConversation conversation, string item)
 {
 }
예제 #8
0
        public virtual void Disconnect(DdemlConversation conversation)
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.GetType().ToString());
            }
            if (!IsRegistered)
            {
                throw new InvalidOperationException(Resources.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);
            }
        }
예제 #9
0
 protected virtual RequestResult OnRequest(DdemlConversation conversation, string item, int format)
 {
     return RequestResult.NotProcessed;
 }
예제 #10
0
 protected virtual PokeResult OnPoke(DdemlConversation conversation, string item, byte[] data, int format)
 {
     return PokeResult.NotProcessed;
 }
예제 #11
0
 protected virtual ExecuteResult OnExecute(DdemlConversation conversation, string command)
 {
     return ExecuteResult.NotProcessed;
 }
예제 #12
0
 protected virtual void OnDisconnect(DdemlConversation conversation)
 {
 }
예제 #13
0
 protected virtual void OnAfterConnect(DdemlConversation conversation)
 {
 }
예제 #14
0
        public virtual void Resume(DdemlConversation conversation)
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.GetType().ToString());
            }
            if (!IsRegistered)
            {
                throw new InvalidOperationException(Resources.NotRegisteredMessage);
            }
            if (conversation == null)
            {
                throw new ArgumentNullException("conversation");
            }
            if (!conversation.IsPaused)
            {
                throw new InvalidOperationException(Resources.NotPausedMessage);
            }

            // Enable the DDEML callback for the specified conversation only.
            bool result = Ddeml.DdeEnableCallback(_InstanceId, conversation.Handle, Ddeml.EC_ENABLEALL);

            // Check the result to see if the DDEML callback was enabled.
            if (!result)
            {
                int error = Ddeml.DdeGetLastError(_InstanceId);
                throw new DdemlException(Resources.ServerResumeFailedMessage, error);
            }

            // Decrement the conversation's waiting count.  The conversation will only resume if the count is zero.
            conversation.DecrementWaiting();
        }
예제 #15
0
 protected override bool OnStartAdvise(DdemlConversation conversation, string item, int format)
 {
     return _Parent.OnStartAdvise((DdeConversation)conversation.Tag, item, format);
 }
예제 #16
0
 protected override void OnStopAdvise(DdemlConversation conversation, string item)
 {
     _Parent.OnStopAdvise((DdeConversation)conversation.Tag, item);
 }
예제 #17
0
 protected virtual bool OnStartAdvise(DdemlConversation conversation, string item, int format)
 {
     return true;
 }