public override bool Match(ConvertTextToElement parser, out object value)
        {
            // Match enabled
            if (parser.Match(parser.Kw(EnabledKey()), false))
            {
                value = true;
                return(true);
            }
            // Match disabled
            else if (parser.Match(parser.Kw(DisabledKey()), false))
            {
                value = false;
                return(true);
            }

            // Unknown
            value = null;
            return(false);
        }
        public override bool Match(ConvertTextToElement parser, out object value)
        {
            // Match the enumerator.
            foreach (string enumerator in Values)
            {
                if (parser.Match(parser.Kw(enumerator), false))
                {
                    // Return true if it is found.
                    value = enumerator;
                    return(true);
                }
            }

            // The value was not found.
            value = null;
            return(false);
        }
 public override bool Match(ConvertTextToElement parser, out object value)
 {
     // If the setting is an integer, match an integer.
     if (Integer)
     {
         if (parser.Integer(out int i))
         {
             // Integer matched.
             value = i;
             return(true);
         }
         else
         {
             // Integer not matched.
             value = null;
             return(false);
         }
     }
     else
     {
         // Match a double.
         if (parser.Double(out double d))
         {
             parser.Match("%");
             // Double matched.
             value = d;
             return(true);
         }
         else
         {
             // Double not matched.
             value = null;
             return(false);
         }
     }
 }