private static bool IsWildCardOrXmlSubType(MediaType subtype)
 {
     return (subtype.IsWildcard ||
       subtype.ToString().Equals("xml", StringComparison.InvariantCultureIgnoreCase) ||
       subtype.ToString().EndsWith("+xml", StringComparison.InvariantCultureIgnoreCase));
 }
예제 #2
0
파일: MediaType.cs 프로젝트: Borzoo/Nancy
 /// <summary>
 /// Matched the media type with another media type.
 /// </summary>
 /// <param name="other">The media type that should be matched against.</param>
 /// <returns><see langword="true" /> if the media types match, otherwise <see langword="false" />.</returns>
 public bool Matches(MediaType other)
 {
     return this.IsWildcard ||
            other.IsWildcard ||
            this.type.Equals(other.type, StringComparison.InvariantCultureIgnoreCase);
 }
 private static bool IsWildCardOrApplicationType(MediaType superType)
 {
     return (superType.IsWildcard || superType.ToString().ToLower().Equals("application"));
 }
 /// <summary>
 /// Matched the media type with another media type.
 /// </summary>
 /// <param name="other">The media type that should be matched against.</param>
 /// <returns><see langword="true" /> if the media types match, otherwise <see langword="false" />.</returns>
 public bool Matches(MediaType other)
 {
     return(this.IsWildcard ||
            other.IsWildcard ||
            this.type.Equals(other.type, StringComparison.InvariantCultureIgnoreCase));
 }