DomainAttribute.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #region Apache License
  2. //
  3. // Licensed to the Apache Software Foundation (ASF) under one or more
  4. // contributor license agreements. See the NOTICE file distributed with
  5. // this work for additional information regarding copyright ownership.
  6. // The ASF licenses this file to you under the Apache License, Version 2.0
  7. // (the "License"); you may not use this file except in compliance with
  8. // the License. You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. //
  18. #endregion
  19. // .NET Compact Framework 1.0 has no support for reading assembly attributes
  20. #if !NETCF
  21. using System;
  22. namespace log4net.Config
  23. {
  24. /// <summary>
  25. /// Assembly level attribute that specifies the logging domain for the assembly.
  26. /// </summary>
  27. /// <remarks>
  28. /// <para>
  29. /// <b>DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute.</b>
  30. /// </para>
  31. /// <para>
  32. /// Assemblies are mapped to logging domains. Each domain has its own
  33. /// logging repository. This attribute specified on the assembly controls
  34. /// the configuration of the domain. The <see cref="RepositoryAttribute.Name"/> property specifies the name
  35. /// of the domain that this assembly is a part of. The <see cref="RepositoryAttribute.RepositoryType"/>
  36. /// specifies the type of the repository objects to create for the domain. If
  37. /// this attribute is not specified and a <see cref="RepositoryAttribute.Name"/> is not specified
  38. /// then the assembly will be part of the default shared logging domain.
  39. /// </para>
  40. /// <para>
  41. /// This attribute can only be specified on the assembly and may only be used
  42. /// once per assembly.
  43. /// </para>
  44. /// </remarks>
  45. /// <author>Nicko Cadell</author>
  46. /// <author>Gert Driesen</author>
  47. [AttributeUsage(AttributeTargets.Assembly)]
  48. [Serializable]
  49. [Obsolete("Use RepositoryAttribute instead of DomainAttribute")]
  50. public sealed class DomainAttribute : RepositoryAttribute
  51. {
  52. #region Public Instance Constructors
  53. /// <summary>
  54. /// Initializes a new instance of the <see cref="DomainAttribute" /> class.
  55. /// </summary>
  56. /// <remarks>
  57. /// <para>
  58. /// Obsolete. Use RepositoryAttribute instead of DomainAttribute.
  59. /// </para>
  60. /// </remarks>
  61. public DomainAttribute() : base()
  62. {
  63. }
  64. /// <summary>
  65. /// Initialize a new instance of the <see cref="DomainAttribute" /> class
  66. /// with the name of the domain.
  67. /// </summary>
  68. /// <param name="name">The name of the domain.</param>
  69. /// <remarks>
  70. /// <para>
  71. /// Obsolete. Use RepositoryAttribute instead of DomainAttribute.
  72. /// </para>
  73. /// </remarks>
  74. public DomainAttribute(string name) : base(name)
  75. {
  76. }
  77. #endregion Public Instance Constructors
  78. }
  79. }
  80. #endif // !NETCF