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