PageRenderTime 101ms CodeModel.GetById 46ms RepoModel.GetById 1ms app.codeStats 0ms

/V1/trunk/Source/StockTraderRI/StockTraderRI.Modules.Market/MarketModule.cs

#
C# | 56 lines | 33 code | 7 blank | 16 comment | 0 complexity | 92b9aba5ca41b4b11fbc3766fd04a3b7 MD5 | raw file
  1. //===============================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation
  4. //===============================================================================
  5. // Copyright (c) Microsoft Corporation. All rights reserved.
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  7. // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  8. // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  9. // FITNESS FOR A PARTICULAR PURPOSE.
  10. //===============================================================================
  11. // The example companies, organizations, products, domain names,
  12. // e-mail addresses, logos, people, places, and events depicted
  13. // herein are fictitious. No association with any real company,
  14. // organization, product, domain name, email address, logo, person,
  15. // places, or events is intended or should be inferred.
  16. //===============================================================================
  17. using System;
  18. using System.Collections.Generic;
  19. using System.Linq;
  20. using System.Text;
  21. using Microsoft.Practices.Composite.Modularity;
  22. using Microsoft.Practices.Unity;
  23. using StockTraderRI.Infrastructure.Interfaces;
  24. using StockTraderRI.Modules.Market.Services;
  25. using StockTraderRI.Modules.Market.TrendLine;
  26. namespace StockTraderRI.Modules.Market
  27. {
  28. public class MarketModule : IModule
  29. {
  30. IUnityContainer _container;
  31. public MarketModule(IUnityContainer container)
  32. {
  33. _container = container;
  34. }
  35. #region IModule Members
  36. public void Initialize()
  37. {
  38. RegisterViewsAndServices();
  39. }
  40. protected void RegisterViewsAndServices()
  41. {
  42. _container.RegisterType<IMarketHistoryService, MarketHistoryService>(new ContainerControlledLifetimeManager());
  43. _container.RegisterType<IMarketFeedService, MarketFeedService>(new ContainerControlledLifetimeManager());
  44. _container.RegisterType<ITrendLineView, TrendLineView>();
  45. _container.RegisterType<ITrendLinePresenter, TrendLinePresenter>();
  46. }
  47. #endregion
  48. }
  49. }