FormattingInfo.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 log4net.Util;
  21. namespace log4net.Util
  22. {
  23. /// <summary>
  24. /// Contain the information obtained when parsing formatting modifiers
  25. /// in conversion modifiers.
  26. /// </summary>
  27. /// <remarks>
  28. /// <para>
  29. /// Holds the formatting information extracted from the format string by
  30. /// the <see cref="PatternParser"/>. This is used by the <see cref="PatternConverter"/>
  31. /// objects when rendering the output.
  32. /// </para>
  33. /// </remarks>
  34. /// <author>Nicko Cadell</author>
  35. /// <author>Gert Driesen</author>
  36. public class FormattingInfo
  37. {
  38. #region Public Instance Constructors
  39. /// <summary>
  40. /// Defaut Constructor
  41. /// </summary>
  42. /// <remarks>
  43. /// <para>
  44. /// Initializes a new instance of the <see cref="FormattingInfo" /> class.
  45. /// </para>
  46. /// </remarks>
  47. public FormattingInfo()
  48. {
  49. }
  50. /// <summary>
  51. /// Constructor
  52. /// </summary>
  53. /// <remarks>
  54. /// <para>
  55. /// Initializes a new instance of the <see cref="FormattingInfo" /> class
  56. /// with the specified parameters.
  57. /// </para>
  58. /// </remarks>
  59. public FormattingInfo(int min, int max, bool leftAlign)
  60. {
  61. m_min = min;
  62. m_max = max;
  63. m_leftAlign = leftAlign;
  64. }
  65. #endregion Public Instance Constructors
  66. #region Public Instance Properties
  67. /// <summary>
  68. /// Gets or sets the minimum value.
  69. /// </summary>
  70. /// <value>
  71. /// The minimum value.
  72. /// </value>
  73. /// <remarks>
  74. /// <para>
  75. /// Gets or sets the minimum value.
  76. /// </para>
  77. /// </remarks>
  78. public int Min
  79. {
  80. get { return m_min; }
  81. set { m_min = value; }
  82. }
  83. /// <summary>
  84. /// Gets or sets the maximum value.
  85. /// </summary>
  86. /// <value>
  87. /// The maximum value.
  88. /// </value>
  89. /// <remarks>
  90. /// <para>
  91. /// Gets or sets the maximum value.
  92. /// </para>
  93. /// </remarks>
  94. public int Max
  95. {
  96. get { return m_max; }
  97. set { m_max = value; }
  98. }
  99. /// <summary>
  100. /// Gets or sets a flag indicating whether left align is enabled
  101. /// or not.
  102. /// </summary>
  103. /// <value>
  104. /// A flag indicating whether left align is enabled or not.
  105. /// </value>
  106. /// <remarks>
  107. /// <para>
  108. /// Gets or sets a flag indicating whether left align is enabled or not.
  109. /// </para>
  110. /// </remarks>
  111. public bool LeftAlign
  112. {
  113. get { return m_leftAlign; }
  114. set { m_leftAlign = value; }
  115. }
  116. #endregion Public Instance Properties
  117. #region Private Instance Fields
  118. private int m_min = -1;
  119. private int m_max = int.MaxValue;
  120. private bool m_leftAlign = false;
  121. #endregion Private Instance Fields
  122. }
  123. }