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

            ExcelDna.Logging.LogDisplay.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)
                    {
                        ExcelDna.Logging.LogDisplay.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;

            ExcelDna.Logging.LogDisplay.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)
                    {
                        ExcelDna.Logging.LogDisplay.WriteLine("Unable to notify Excel: {0}", comex.ToString());
                    }
                };
                listener.Start();

                topics.Add(topicId, listener);
            }

            return("WAIT");
        }