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