PageRenderTime 22ms CodeModel.GetById 18ms app.highlight 2ms 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
18using System;
19using System.Collections.Generic;
20using System.Linq;
21using System.Text;
22using Microsoft.Practices.Composite.Modularity;
23using Microsoft.Practices.Unity;
24using StockTraderRI.Infrastructure.Interfaces;
25using StockTraderRI.Modules.Market.Services;
26using StockTraderRI.Modules.Market.TrendLine;
27
28namespace StockTraderRI.Modules.Market
29{
30    public class MarketModule : IModule
31    {
32        IUnityContainer _container;
33
34        public MarketModule(IUnityContainer container)
35        {
36            _container = container;
37        }
38
39        #region IModule Members
40
41        public void Initialize()
42        {
43            RegisterViewsAndServices();
44        }
45
46        protected void RegisterViewsAndServices()
47        {
48            _container.RegisterType<IMarketHistoryService, MarketHistoryService>(new ContainerControlledLifetimeManager());
49            _container.RegisterType<IMarketFeedService, MarketFeedService>(new ContainerControlledLifetimeManager());
50            _container.RegisterType<ITrendLineView, TrendLineView>();
51            _container.RegisterType<ITrendLinePresenter, TrendLinePresenter>();
52        }
53
54        #endregion
55    }
56}