public static TOSTopicConnection GetTOSTopicConnection(TOSTopic topic)
 {
     if (!_topicConnections.ContainsKey(topic))
     {
         _topicConnections.Add(topic, new TOSTopicConnection(topic));
     }
     return(_topicConnections[topic]);
 }
 private TOSTopicConnection(TOSTopic topic)
 {
     Topic           = topic;
     c               = new DdeClient("TOS", topic.Name);
     c.Advise       += new EventHandler <DdeAdviseEventArgs>(c_Advise);
     c.Disconnected += new EventHandler <DdeDisconnectedEventArgs>(c_Disconnected);
     c.Connect();
 }
Example #3
0
            public void Update(TOSTopic topic, string strvalue)
            {
                decimal value;

                if (!Decimal.TryParse(strvalue, out value))
                {
                    return;
                }
                if (topic.Equals(TOSTopic.Ask))
                {
                    a = value;
                }
                else if (topic.Equals(TOSTopic.Bid))
                {
                    b = value;
                }
            }
Example #4
0
 internal TOSDataPoint(TOSTopic topic, string item)
 {
     Topic = topic;
     Item  = item;
 }