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"); }
public int ServerStart(IRTDUpdateEvent CallbackObject) { LoggingWindow.WriteLine("Starting server"); callback = CallbackObject; return(1); }
public static void WriteLine(string format, params object[] args) { if (instance == null) { instance = new LoggingWindow(); instance.Show(); } instance.Show(); instance.listBoxMessages.Items.Add(string.Format(format, args)); }
public static void WriteLine(string format, params object[] args) { if (instance == null) { instance = new LoggingWindow(); instance.Show(); } instance.Show(); instance.listBoxMessages.Items.Add(string.Format(format, args)); }
public void DisconnectData(int topicID) { LoggingWindow.WriteLine("Disconnecting: {0}", topicID); lock (topics) { var listener = topics[topicID]; listener.Stop(); topics.Remove(topicID); } }
public void ServerTerminate() { LoggingWindow.WriteLine("Stopping server"); callback = null; }