PageRenderTime 76ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/V2.2/trunk/Quickstarts/UI Composition/ViewInjection/Desktop/UIComposition.Modules.Project/ProjectModule.cs

#
C# | 45 lines | 24 code | 5 blank | 16 comment | 0 complexity | f98b82c79135d34d3cef183e22307060 MD5 | raw file
  1. //===================================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation and Silverlight
  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 Microsoft.Practices.Composite.Modularity;
  18. using Microsoft.Practices.Unity;
  19. using UIComposition.Modules.Project.Services;
  20. namespace UIComposition.Modules.Project
  21. {
  22. public class ProjectModule : IModule
  23. {
  24. private readonly IUnityContainer container;
  25. public ProjectModule(IUnityContainer container)
  26. {
  27. this.container = container;
  28. }
  29. public void Initialize()
  30. {
  31. this.RegisterViewsAndServices();
  32. }
  33. protected void RegisterViewsAndServices()
  34. {
  35. this.container.RegisterType<IProjectService, ProjectService>(new ContainerControlledLifetimeManager());
  36. this.container.RegisterType<IProjectsListView, ProjectsListView>();
  37. this.container.RegisterType<IProjectsListPresenter, ProjectsListPresenter>();
  38. }
  39. }
  40. }