Esempio n. 1
0
 internal bool Check(string value)
 {
     if (String.IsNullOrEmpty(value))
     {
         return(false);
     }
     return
         ((AllowWords.Any(word => String.Equals(word, value, StringComparison.InvariantCultureIgnoreCase)) ||
           AllowPrefixes.Any(pfx => value.StartsWith(pfx, StringComparison.InvariantCultureIgnoreCase))) ||
          (Vowels.Any(v => Char.ToUpperInvariant(v) == Char.ToUpperInvariant(value[0])) &&
           !IgnorePrefixes.Any(pfx => value.StartsWith(pfx, StringComparison.InvariantCultureIgnoreCase)) &&
           !IgnoreWords.Any(word => String.Equals(word, value, StringComparison.InvariantCultureIgnoreCase))));
 }
Esempio n. 2
0
        private static XmlNode FillIn(XmlDocument optionsDocument)
        {
            XmlNode      result = optionsDocument.CreateNode("element", "Options", "");
            XmlNode      option;
            XmlAttribute name;

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnoreChildOrder";
            option.Attributes.Append(name);
            option.InnerText = IgnoreChildOrder.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnoreComments";
            option.Attributes.Append(name);
            option.InnerText = IgnoreComments.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnoreDtd";
            option.Attributes.Append(name);
            option.InnerText = IgnoreDtd.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnoreNamespaces";
            option.Attributes.Append(name);
            option.InnerText = IgnoreNamespaces.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnorePI";
            option.Attributes.Append(name);
            option.InnerText = IgnorePI.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnorePrefixes";
            option.Attributes.Append(name);
            option.InnerText = IgnorePrefixes.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnoreWhitespace";
            option.Attributes.Append(name);
            option.InnerText = IgnoreWhitespace.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "IgnoreXmlDecl";
            option.Attributes.Append(name);
            option.InnerText = IgnoreXmlDecl.ToString().ToLower();
            result.AppendChild(option);

            option     = optionsDocument.CreateNode("element", "Option", "");
            name       = optionsDocument.CreateAttribute("Name");
            name.Value = "None";
            option.Attributes.Append(name);
            option.InnerText = None.ToString().ToLower();
            result.AppendChild(option);

            return(result);
        }