PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/V1/spikes/AGCompositeApplicationLibrary/AGComposite/Modularity/ModuleAttribute.cs

#
C# | 49 lines | 15 code | 4 blank | 30 comment | 0 complexity | 5bbc9d70c40d2848b48df43d903bec07 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
18using System;
19
20namespace Microsoft.Practices.Composite.Modularity
21{
22    /// <summary>
23    /// Indicates that the class should be considered a named module using the
24    /// provided module name.
25    /// </summary>
26    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
27    public sealed class ModuleAttribute : Attribute
28    {
29        private bool _startupLoaded = true;
30
31        /// <summary>
32        /// Gets or sets the name of the module.
33        /// </summary>
34        /// <value>The name of the module.</value>
35        public string ModuleName { get; set; }
36
37        /// <summary>
38        /// Gets or sets a value indicating whether the module should be loaded at startup. 
39        /// </summary>
40        /// When <see langword="true"/> (default value), it indicates that this module should be loaded at startup. 
41        /// Otherwise you should explicitly load this module on demand.
42        /// <value>A <see cref="bool"/> value.</value>
43        public bool StartupLoaded
44        {
45            get { return _startupLoaded; }
46            set { _startupLoaded = value; }
47        }
48    }
49}