PageRenderTime 41ms CodeModel.GetById 19ms RepoModel.GetById 0ms 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. //===================================================================================
  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. /// <summary>
  28. /// Gets or sets the name of the module.
  29. /// </summary>
  30. /// <value>The name of the module.</value>
  31. public string ModuleName { get; set; }
  32. /// <summary>
  33. /// Gets or sets a value indicating whether the module should be loaded at startup.
  34. /// </summary>
  35. /// When <see langword="true"/> (default value), it indicates that this module should be loaded at startup.
  36. /// Otherwise you should explicitly load this module on demand.
  37. /// <value>A <see cref="bool"/> value.</value>
  38. [Obsolete("StartupLoaded has been replaced by the OnDemand property.")]
  39. public bool StartupLoaded
  40. {
  41. get { return !OnDemand; }
  42. set { OnDemand = !value; }
  43. }
  44. /// <summary>
  45. /// Gets or sets the value indicating whether the module should be loaded OnDemand.
  46. /// </summary>
  47. /// When <see langword="false"/> (default value), it indicates the module should be loaded as soon as it's dependencies are satisfied.
  48. /// Otherwise you should explicitily load this module via the <see cref="ModuleManager"/>.
  49. public bool OnDemand { get; set; }
  50. }
  51. }