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