コード例 #1
0
 /// <summary>
 /// Try parses the string to a MediaType object.
 /// </summary>
 /// <param name="s">The string.</param>
 /// <param name="mediaType">Type of the media.</param>
 /// <returns></returns>
 public static bool TryParse(string s, out MediaType mediaType)
 {
     try
     {
         mediaType = MediaType.Parse(s);
         return true;
     }
     catch
     {
         mediaType = null;
         return false;
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentCollection"/> class.
 /// </summary>
 public DocumentCollection()
     : base(MediaType.Parse(MIME_TYPE))
 {
 }