PageRenderTime 41ms CodeModel.GetById 32ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/V4/PrismLibrary/Desktop/Prism/Modularity/ModuleConfigurationElement.Desktop.cs

#
C# | 104 lines | 48 code | 7 blank | 49 comment | 0 complexity | 6cd08cef3350a502619ea2da6f65a0ca 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.Configuration;
 18
 19namespace Microsoft.Practices.Prism.Modularity
 20{
 21    /// <summary>
 22    /// A configuration element to declare module metadata.
 23    /// </summary>
 24    public class ModuleConfigurationElement : ConfigurationElement
 25    {
 26        /// <summary>
 27        /// Initializes a new instance of <see cref="ModuleConfigurationElement"/>.
 28        /// </summary>
 29        public ModuleConfigurationElement()
 30        {
 31        }
 32
 33        /// <summary>
 34        /// Initializes a new instance of <see cref="ModuleConfigurationElement"/>.
 35        /// </summary>
 36        /// <param name="assemblyFile">The assembly file where the module is located.</param>
 37        /// <param name="moduleType">The type of the module.</param>
 38        /// <param name="moduleName">The name of the module.</param>
 39        /// <param name="startupLoaded">This attribute specifies whether the module is loaded at startup.</param>
 40        public ModuleConfigurationElement(string assemblyFile, string moduleType, string moduleName, bool startupLoaded)
 41        {
 42            base["assemblyFile"] = assemblyFile;
 43            base["moduleType"] = moduleType;
 44            base["moduleName"] = moduleName;
 45            base["startupLoaded"] = startupLoaded;
 46        }
 47
 48        /// <summary>
 49        /// Gets or sets the assembly file.
 50        /// </summary>
 51        /// <value>The assembly file.</value>
 52        [ConfigurationProperty("assemblyFile", IsRequired = true)]
 53        public string AssemblyFile
 54        {
 55            get { return (string)base["assemblyFile"]; }
 56            set { base["assemblyFile"] = value; }
 57        }
 58
 59        /// <summary>
 60        /// Gets or sets the module type.
 61        /// </summary>
 62        /// <value>The module's type.</value>
 63        [ConfigurationProperty("moduleType", IsRequired = true)]
 64        public string ModuleType
 65        {
 66            get { return (string)base["moduleType"]; }
 67            set { base["moduleType"] = value; }
 68        }
 69
 70        /// <summary>
 71        /// Gets or sets the module name.
 72        /// </summary>
 73        /// <value>The module's name.</value>
 74        [ConfigurationProperty("moduleName", IsRequired = true)]
 75        public string ModuleName
 76        {
 77            get { return (string)base["moduleName"]; }
 78            set { base["moduleName"] = value; }
 79        }
 80
 81        /// <summary>
 82        /// Gets or sets a value indicating whether the module should be loaded at startup.
 83        /// </summary>
 84        /// <value>A value indicating whether the module should be loaded at startup.</value>
 85        [ConfigurationProperty("startupLoaded", IsRequired = false, DefaultValue = true)]
 86        public bool StartupLoaded
 87        {
 88            get { return (bool)base["startupLoaded"]; }
 89            set { base["startupLoaded"] = value; }
 90        }
 91
 92        /// <summary>
 93        /// Gets or sets the modules this module depends on.
 94        /// </summary>
 95        /// <value>The names of the modules that this depends on.</value>
 96        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
 97        [ConfigurationProperty("dependencies", IsDefaultCollection = true, IsKey = false)]
 98        public ModuleDependencyCollection Dependencies
 99        {
100            get { return (ModuleDependencyCollection)base["dependencies"]; }
101            set { base["dependencies"] = value; }
102        }
103    }
104}