LevelMappingEntry.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. using System;
  20. using System.Collections;
  21. using log4net.Core;
  22. namespace log4net.Util
  23. {
  24. /// <summary>
  25. /// An entry in the <see cref="LevelMapping"/>
  26. /// </summary>
  27. /// <remarks>
  28. /// <para>
  29. /// This is an abstract base class for types that are stored in the
  30. /// <see cref="LevelMapping"/> object.
  31. /// </para>
  32. /// </remarks>
  33. /// <author>Nicko Cadell</author>
  34. public abstract class LevelMappingEntry : IOptionHandler
  35. {
  36. #region Public Instance Constructors
  37. /// <summary>
  38. /// Default protected constructor
  39. /// </summary>
  40. /// <remarks>
  41. /// <para>
  42. /// Default protected constructor
  43. /// </para>
  44. /// </remarks>
  45. protected LevelMappingEntry()
  46. {
  47. }
  48. #endregion // Public Instance Constructors
  49. #region Public Instance Properties
  50. /// <summary>
  51. /// The level that is the key for this mapping
  52. /// </summary>
  53. /// <value>
  54. /// The <see cref="Level"/> that is the key for this mapping
  55. /// </value>
  56. /// <remarks>
  57. /// <para>
  58. /// Get or set the <see cref="Level"/> that is the key for this
  59. /// mapping subclass.
  60. /// </para>
  61. /// </remarks>
  62. public Level Level
  63. {
  64. get { return m_level; }
  65. set { m_level = value; }
  66. }
  67. #endregion // Public Instance Properties
  68. #region IOptionHandler Members
  69. /// <summary>
  70. /// Initialize any options defined on this entry
  71. /// </summary>
  72. /// <remarks>
  73. /// <para>
  74. /// Should be overridden by any classes that need to initialise based on their options
  75. /// </para>
  76. /// </remarks>
  77. virtual public void ActivateOptions()
  78. {
  79. // default implementation is to do nothing
  80. }
  81. #endregion // IOptionHandler Members
  82. #region Private Instance Fields
  83. private Level m_level;
  84. #endregion // Private Instance Fields
  85. }
  86. }