示例#1
0
 /// <summary>
 /// Returns <code>true</code> if the primary type and the
 /// subtype of this object are the same as the specified
 /// <code>type</code>; otherwise returns <code>false</code>.
 /// </summary>
 /// <param name="type"> the type to compare to <code>this</code>'s type </param>
 /// <returns> <code>true</code> if the primary type and the
 ///    subtype of this object are the same as the
 ///    specified <code>type</code>; otherwise returns
 ///    <code>false</code> </returns>
 public virtual bool Match(MimeType type)
 {
     if (type == null)
     {
         return(false);
     }
     return(PrimaryType_Renamed.Equals(type.PrimaryType) && (SubType_Renamed.Equals("*") || type.SubType.Equals("*") || (SubType_Renamed.Equals(type.SubType))));
 }
示例#2
0
        public override int HashCode()
        {
            // We sum up the hash codes for all of the strings. This
            // way, the order of the strings is irrelevant
            int code = 0;

            code += PrimaryType_Renamed.HashCode();
            code += SubType_Renamed.HashCode();
            code += Parameters_Renamed.HashCode();
            return(code);
        }         // hashCode()