PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/V4/Quickstarts/Modularity/Desktop/ModularityWithUnity/ModuleD/ModuleD.cs

#
C# | 54 lines | 24 code | 4 blank | 26 comment | 2 complexity | 5381562d7027047cc68bbf4ed692db37 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 System;
  18. using Microsoft.Practices.Prism.Modularity;
  19. using ModuleTracking;
  20. namespace ModularityWithUnity.Desktop
  21. {
  22. /// <summary>
  23. /// A module for the quickstart.
  24. /// </summary>
  25. [Module(ModuleName = WellKnownModuleNames.ModuleD)]
  26. public class ModuleD : IModule
  27. {
  28. private IModuleTracker moduleTracker;
  29. /// <summary>
  30. /// Initializes a new instance of the <see cref="ModuleD"/> class.
  31. /// </summary>
  32. /// <param name="moduleTracker">The module tracker.</param>
  33. public ModuleD(IModuleTracker moduleTracker)
  34. {
  35. if (moduleTracker == null)
  36. {
  37. throw new ArgumentNullException("moduleTracker");
  38. }
  39. this.moduleTracker = moduleTracker;
  40. this.moduleTracker.RecordModuleConstructed(WellKnownModuleNames.ModuleD);
  41. }
  42. /// <summary>
  43. /// Notifies the module that it has be initialized.
  44. /// </summary>
  45. public void Initialize()
  46. {
  47. this.moduleTracker.RecordModuleInitialized(WellKnownModuleNames.ModuleD);
  48. }
  49. }
  50. }