PageRenderTime 46ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/src/NUnit/UiException/CodeFormatters/IFormatterCatalog.cs

#
C# | 36 lines | 11 code | 3 blank | 22 comment | 0 complexity | 4c32300d097a9115bfbfaaf434b19cf2 MD5 | raw file
Possible License(s): GPL-2.0
  1. // ****************************************************************
  2. // This is free software licensed under the NUnit license. You may
  3. // obtain a copy of the license at http://nunit.org
  4. // ****************************************************************
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Text;
  8. namespace NUnit.UiException.CodeFormatters
  9. {
  10. /// <summary>
  11. /// The interface through which SourceCodeDisplay interacts to guess
  12. /// the language from a file extension.
  13. ///
  14. /// Direct implementation is:
  15. /// - GeneralCodeFormatter
  16. /// </summary>
  17. public interface IFormatterCatalog
  18. {
  19. /// <summary>
  20. /// Format the text using the given language formatting.
  21. /// </summary>
  22. /// <param name="text">A text to be formatted</param>
  23. /// <param name="language">The language with which formatting the text</param>
  24. /// <returns>A FormatterCode object</returns>
  25. FormattedCode Format(string text, string language);
  26. /// <summary>
  27. /// Gets the language from the given extension.
  28. /// </summary>
  29. /// <param name="extension">An extension without the dot, like 'cs'</param>
  30. /// <returns>A language name, like 'C#'</returns>
  31. string LanguageFromExtension(string extension);
  32. }
  33. }