/// <summary> /// Initializes a new instance of the <see cref="HtmlResponder"/> class. /// </summary> public HtmlResponder() { SupportedFormat = "html"; foreach (string mimeType in KnownMimeTypes.HtmlTypes()) { SupportedMimeTypes.Add(mimeType); } }
/// <summary> /// Initializes a new instance of the <see cref="XmlResponder"/> class. /// </summary> public XmlResponder() { SupportedFormat = "xml"; ContentType = KnownMimeTypes.XmlTypes()[0]; foreach (string mimeType in KnownMimeTypes.XmlTypes()) { SupportedMimeTypes.Add(mimeType); } }
/// <summary> /// Initializes a new instance of the <see cref="JsonResponder"/> class. /// </summary> public JsonResponder() { SupportedFormat = "json"; ContentType = KnownMimeTypes.JsonTypes()[0]; foreach (string mimeType in KnownMimeTypes.JsonTypes()) { SupportedMimeTypes.Add(mimeType); } }
/// <summary> /// Determines whether this instance [can respond to MIME type] the specified MIME type. /// </summary> /// <param name="mimeType">Type of the MIME.</param> /// <returns> /// <c>true</c> if this instance [can respond to MIME type] the specified MIME type; otherwise, <c>false</c>. /// </returns> public virtual bool CanRespondToMimeType(string mimeType) { return(SupportedMimeTypes.Any(mt => mt.Equals(mimeType, StringComparison.OrdinalIgnoreCase))); }
public override string ToString() { return(string.Format("[ReferenceFinderCodon: SupportedMimeTypes={0}, ReferenceFinder={1}]", SupportedMimeTypes.Count() + ":" + String.Join(";", SupportedMimeTypes), ReferenceFinder)); }