/V4/Quickstarts/Modularity/Silverlight/ModularityWithUnity/ModuleB/ModuleB.cs
C# | 53 lines | 23 code | 4 blank | 26 comment | 2 complexity | 961e2feb44f9eda0805173fd47643a22 MD5 | raw file
- //===================================================================================
- // Microsoft patterns & practices
- // Composite Application Guidance for Windows Presentation Foundation and Silverlight
- //===================================================================================
- // Copyright (c) Microsoft Corporation. All rights reserved.
- // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
- // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
- // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- // FITNESS FOR A PARTICULAR PURPOSE.
- //===================================================================================
- // The example companies, organizations, products, domain names,
- // e-mail addresses, logos, people, places, and events depicted
- // herein are fictitious. No association with any real company,
- // organization, product, domain name, email address, logo, person,
- // places, or events is intended or should be inferred.
- //===================================================================================
- namespace ModuleB
- {
- using System;
- using Microsoft.Practices.Prism.Modularity;
- using ModuleTracking;
-
- /// <summary>
- /// A module for the quickstart.
- /// </summary>
- public class ModuleB : IModule
- {
- private IModuleTracker moduleTracker;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ModuleB"/> class.
- /// </summary>
- /// <param name="moduleTracker">The module tracker.</param>
- public ModuleB(IModuleTracker moduleTracker)
- {
- if (moduleTracker == null)
- {
- throw new ArgumentNullException("moduleTracker");
- }
-
- this.moduleTracker = moduleTracker;
- this.moduleTracker.RecordModuleConstructed(WellKnownModuleNames.ModuleB);
- }
-
- /// <summary>
- /// Notifies the module that it has be initialized.
- /// </summary>
- public void Initialize()
- {
- this.moduleTracker.RecordModuleInitialized(WellKnownModuleNames.ModuleB);
- }
- }
- }