PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
C# | 36 lines | 11 code | 3 blank | 22 comment | 0 complexity | 4c32300d097a9115bfbfaaf434b19cf2 MD5 | raw file
 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
 6using System;
 7using System.Collections.Generic;
 8using System.Text;
 9
10namespace NUnit.UiException.CodeFormatters
11{
12    /// <summary>
13    /// The interface through which SourceCodeDisplay interacts to guess
14    /// the language from a file extension.
15    /// 
16    /// Direct implementation is:
17    ///     - GeneralCodeFormatter
18    /// </summary>
19    public interface IFormatterCatalog
20    {
21        /// <summary>
22        /// Format the text using the given language formatting.
23        /// </summary>
24        /// <param name="text">A text to be formatted</param>
25        /// <param name="language">The language with which formatting the text</param>
26        /// <returns>A FormatterCode object</returns>
27        FormattedCode Format(string text, string language);
28
29        /// <summary>
30        /// Gets the language from the given extension.
31        /// </summary>
32        /// <param name="extension">An extension without the dot, like 'cs'</param>
33        /// <returns>A language name, like 'C#'</returns>
34        string LanguageFromExtension(string extension);
35    }
36}