Ejemplo n.º 1
0
 public void Request(object sender, string itemName, out string strData)
 {
     using (var ds = new DDESender(this, sender))
     {
         m_commands.Enqueue(new Command(ds, DDEAction.Request, itemName));
         //DDECompletitionManager.Instance.Post(() => ProcessCommand(new Command(ds, DDEAction.Request, itemName)));
         strData = (WaitComplete()) ? ds.ValueText : null;
     }
 }
Ejemplo n.º 2
0
 public void ExecuteMacro(string strText)
 {
     using (var ds = new DDESender(this, this.System))
     {
         m_commands.Enqueue(new Command(ds, DDEAction.Send, strText));
         //DDECompletitionManager.Instance.Post(() => ProcessCommand(new Command(ds, DDEAction.Send, strText)));
         WaitComplete();
     }
 }
Ejemplo n.º 3
0
        public void Close(IDDESender sender)
        {
            Connection conn;

            if (m_connections.TryGetValue(sender, out conn))
            {
                using (var ds = new DDESender(this, sender))
                {
                    m_commands.Enqueue(new Command(ds, DDEAction.Close));
                    //DDECompletitionManager.Instance.Post(() => ProcessCommand(new Command(ds, DDEAction.Close)));
                    WaitComplete();
                    //m_complete.WaitOne(Timeout.Infinite);
                }
            }
        }
Ejemplo n.º 4
0
        public bool Open(object sender, string topicName)
        {
            Connection conn;

            if (m_connections.TryGetValue(sender, out conn))
            {
                return(true);
            }

            using (var ds = new DDESender(this, sender)
            {
                ValueText = "False"
            })
            {
                m_commands.Enqueue(new Command(ds, DDEAction.Open, topicName));
                //DDECompletitionManager.Instance.Post(() => ProcessCommand(new Command(ds, DDEAction.Open, topicName)));

                return((WaitComplete()) ? bool.Parse(ds.ValueText) : false);
                //return (m_complete.WaitOne(Timeout.Infinite)) ? bool.Parse(ds.ValueText) : false;
            }
        }