// ***************************************************************** // **** Constructors **** // ***************************************************************** // public TestMarket() { InitializeComponent(); // Set application information - do this before hubs are instantiated. string basePath = UV.Lib.IO.FilesIO.GetPathToDirName(System.IO.Directory.GetCurrentDirectory(), "Ambre", true); AppInfo info = AppInfo.GetInstance(); info.BasePath = basePath; info.LogDirectory = string.Format("{0}{1}", info.LogDirectory, UV.Lib.IO.FilesIO.GetTodaysLogDirAndClean(info.LogPath)); // Instantiate the API. m_TTServices = TTApiService.GetInstance(); m_TTServices.ServiceStateChanged += new EventHandler(TTServices_ServiceStateChanged); // Instantiate hubs // but do not Connect until the user name/pw has been authenticated. m_Market = new Markets.MarketTTAPI(); m_Market.Start(); //m_Market.MarketStatusChanged += new EventHandler<UVLib.MarketHubs.MarketStatusChangedEventArg>(Market_MarketStatusChanged); //m_Market.FoundServiceResource += new EventHandler<MarketFoundServiceResource>(Market_MarketFoundServiceResource); m_Market.MarketStatusChanged += new EventHandler(Market_MarketStatusChanged); m_Market.FoundResource += new EventHandler(Market_MarketFoundServiceResource); timer1.Tick += new EventHandler(timer1_Tick); timer1.Interval = 1000; }
}//Start() // // public void AddHub(Misty.Lib.Hubs.Hub hub) { if (hub is Markets.MarketTTAPI) { if (m_Market != null) { m_Market.FoundResource -= new EventHandler(HubEventEnqueue); // disconnect any previous mkt hub. } m_Market = (Markets.MarketTTAPI)hub; m_Market.FoundResource += new EventHandler(HubEventEnqueue); } }//AddHub()