PageRenderTime 28ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/V1/trunk/Source/QuickStarts/Modularity/DirectoryLookupModularity/ModuleB/DefaultViewB.xaml.cs

#
C# | 45 lines | 21 code | 5 blank | 19 comment | 0 complexity | 2553b400fec825a379425db967e5e33d MD5 | raw file
 1//===============================================================================
 2// Microsoft patterns & practices
 3// Composite Application Guidance for Windows Presentation Foundation
 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
18using System.Windows;
19using System.Windows.Controls;
20using Microsoft.Practices.Composite.Modularity;
21
22namespace ModuleB
23{
24    /// <summary>
25    /// Interaction logic for DefaultViewB.xaml
26    /// </summary>
27    public partial class DefaultViewB : UserControl
28    {
29        private readonly IModuleLoader moduleLoader;
30        private readonly IModuleEnumerator moduleEnumerator;
31
32        public DefaultViewB(IModuleLoader moduleLoader, IModuleEnumerator moduleEnumerator)
33        {
34            this.moduleLoader = moduleLoader;
35            this.moduleEnumerator = moduleEnumerator;
36
37            InitializeComponent();
38        }
39
40        private void OnLoadModuleCClick(object sender, RoutedEventArgs e)
41        {
42            moduleLoader.Initialize(new ModuleInfo[] {moduleEnumerator.GetModule("ModuleC")});
43        }
44    }
45}