예제 #1
0
        public object ConnectData(int topicId, ref Array strings, ref bool newValues)
        {
            var isin = strings.GetValue(0) as string;

            LoggingWindow.WriteLine("Connecting: {0} {1}", topicId, isin);

            lock (topics)
            {
                // create a listener for this topic
                var listener = new SpotListener(isin);
                listener.OnUpdate += (sender, args) =>
                {
                    try
                    {
                        if (callback != null)
                        {
                            callback.UpdateNotify();
                        }
                    }
                    catch (COMException comex)
                    {
                        LoggingWindow.WriteLine("Unable to notify Excel: {0}", comex.ToString());
                    }
                };
                listener.Start();

                topics.Add(topicId, listener);
            }

            return "WAIT";
        }
예제 #2
0
        public object ConnectData(int topicId, ref Array strings, ref bool newValues)
        {
            var isin = strings.GetValue(0) as string;

            LoggingWindow.WriteLine("Connecting: {0} {1}", topicId, isin);

            lock (topics)
            {
                // create a listener for this topic
                var listener = new SpotListener(isin);
                listener.OnUpdate += (sender, args) =>
                {
                    try
                    {
                        if (callback != null)
                        {
                            callback.UpdateNotify();
                        }
                    }
                    catch (COMException comex)
                    {
                        LoggingWindow.WriteLine("Unable to notify Excel: {0}", comex.ToString());
                    }
                };
                listener.Start();

                topics.Add(topicId, listener);
            }

            return("WAIT");
        }