//the plain constructor public SubscriptionManager(Logger log, ConsorsGate cg) { _log = log; _cg = cg; _connections = new ArrayList(); _log.info("SubscriptionManager::SubscriptionManager", "constructing."); }
// the quote system constructor public QuoteSystem(Logger l, ConsorsGate cg) { //setting the local variables _log = l; _cg = cg; _log.info("QuoteSystem::QuoteSystem", "constructing quote system"); //initialize the consors system. // Create the session facade try{ sf = new SessionFacade(); // Login sf.LoginWithAddOnName("Ulrich Staudinger"); _log.info("QuoteSystem::QuoteSystem", "logged in."); //registering for now, the plain dax values. // Create the parameters that you need for the quote subscription, here the QuoteKey QuoteKey qk = sf.CreateQuoteKey(); // Set all necessary parameters qk.SecurityCode = "846900"; qk.StockexchangeId = "ETR"; // Acquire the subscription with this QuoteKey QuoteSubscription qs = sf.GetQuoteSubscription(qk); // Register your event handler on the subscription CallbackQuote cbQuote = new CallbackQuote(quoteHandler); qs.OnQuoteUpdate += cbQuote; _log.info("QuoteSystem::QuoteSystem", "subscribed to dax."); } catch (Exception ex) { _log.fatal("QuoteSystem::QuoteSystem", "Exception while starting QuoteSystem:"); _log.fatal("QuoteSystem::QuoteSystem", ex.Message); } Thread constantRunner = new Thread(new ThreadStart(Run)); constantRunner.Start(); }
public static void Main() { ConsorsGate cg=new ConsorsGate(new Logger("test.log")); }