PageRenderTime 45ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/V4/Quickstarts/Modularity/Silverlight/ModularityWithUnity/ModuleB/ModuleB.cs

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