IDateFormatter.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.IO;
  21. namespace log4net.DateFormatter
  22. {
  23. /// <summary>
  24. /// Render a <see cref="DateTime"/> as a string.
  25. /// </summary>
  26. /// <remarks>
  27. /// <para>
  28. /// Interface to abstract the rendering of a <see cref="DateTime"/>
  29. /// instance into a string.
  30. /// </para>
  31. /// <para>
  32. /// The <see cref="FormatDate"/> method is used to render the
  33. /// date to a text writer.
  34. /// </para>
  35. /// </remarks>
  36. /// <author>Nicko Cadell</author>
  37. /// <author>Gert Driesen</author>
  38. public interface IDateFormatter
  39. {
  40. /// <summary>
  41. /// Formats the specified date as a string.
  42. /// </summary>
  43. /// <param name="dateToFormat">The date to format.</param>
  44. /// <param name="writer">The writer to write to.</param>
  45. /// <remarks>
  46. /// <para>
  47. /// Format the <see cref="DateTime"/> as a string and write it
  48. /// to the <see cref="TextWriter"/> provided.
  49. /// </para>
  50. /// </remarks>
  51. void FormatDate(DateTime dateToFormat, TextWriter writer);
  52. }
  53. }