Exemplo n.º 1
0
 internal override bool Read(HTMLTextReader myReader)
 {
     if (base.Read(myReader))
     {
         if (this.HasAttribute("charset"))
         {
             string v = this.GetAttribute("charset");
             if (string.IsNullOrEmpty(this.OwnerDocument.CharSet) == false)
             {
                 if (string.Compare(v, this.OwnerDocument.CharSet, true) != 0)
                 {
                     this.OwnerDocument.CharSet = v;
                     throw new HTMLChangeCharSetException(v);
                 }
             }
         }
         if (this.HasAttribute("content"))
         {
             System.Collections.Specialized.NameValueCollection myValues = HTMLTextReader.AnalyseValueString(this.GetAttribute("content"));
             foreach (string strKey in myValues.Keys)
             {
                 if (string.Compare(strKey, "charset", true) == 0)
                 {
                     string strValue = myValues[strKey];
                     if (strValue != null)
                     {
                         strValue = strValue.Trim();
                         if (myOwnerDocument.CharSet != null)
                         {
                             if (string.Compare(strValue, myOwnerDocument.CharSet, true) != 0)
                             {
                                 myOwnerDocument.CharSet = strValue;
                                 throw new HTMLChangeCharSetException(strValue);
                             }
                         }
                     }
                 }
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }