PageRenderTime 14ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/V2.2/trunk/CAL/Desktop/Composite/Modularity/ModuleAttribute.cs

#
C# | 55 lines | 16 code | 4 blank | 35 comment | 0 complexity | 2b9e9661e597c95909f4832612eb2f16 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;
18
19namespace Microsoft.Practices.Composite.Modularity
20{
21    /// <summary>
22    /// Indicates that the class should be considered a named module using the
23    /// provided module name.
24    /// </summary>
25    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
26    public sealed class ModuleAttribute : Attribute
27    {
28        /// <summary>
29        /// Gets or sets the name of the module.
30        /// </summary>
31        /// <value>The name of the module.</value>
32        public string ModuleName { get; set; }
33
34        /// <summary>
35        /// Gets or sets a value indicating whether the module should be loaded at startup. 
36        /// </summary>
37        /// When <see langword="true"/> (default value), it indicates that this module should be loaded at startup. 
38        /// Otherwise you should explicitly load this module on demand.
39        /// <value>A <see cref="bool"/> value.</value>
40        [Obsolete("StartupLoaded has been replaced by the OnDemand property.")]
41        public bool StartupLoaded
42        {
43            get { return !OnDemand; }
44            set { OnDemand = !value; }
45        }
46
47
48        /// <summary>
49        /// Gets or sets the value indicating whether the module should be loaded OnDemand.
50        /// </summary>
51        /// When <see langword="false"/> (default value), it indicates the module should be loaded as soon as it's dependencies are satisfied.
52        /// Otherwise you should explicitily load this module via the <see cref="ModuleManager"/>.
53        public bool OnDemand { get; set; }
54    }
55}