Example #1
0
        /// <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);
            }
        }
Example #2
0
        /// <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);
            }
        }
Example #3
0
        /// <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);
            }
        }
Example #4
0
 /// <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)));
 }
Example #5
0
 public override string ToString()
 {
     return(string.Format("[ReferenceFinderCodon: SupportedMimeTypes={0}, ReferenceFinder={1}]", SupportedMimeTypes.Count() + ":" + String.Join(";", SupportedMimeTypes), ReferenceFinder));
 }