Beispiel #1
0
        /// <summary>
        /// Parse the list of property values and build the property instance
        /// </summary>
        /// <param name="values">List of the lexemes of the values to init the property instance with</param>
        /// <returns>An instance of the property constructed with the values given</returns>
        public static IProperty Parse(List <string> values)
        {
            if (values.Count != 1)
            {
                return(null);
            }

            try {
                var parser = NaiveLexer.ComposedSimpleText.Select <List <string> >(ss => new List <string>(ss));
                var parts  = parser.Parse(values[0]);

                if (!parts.Success)
                {
                    return(null);
                }

                if (parts.Value.Count != 2)
                {
                    return(null);
                }

                return(new Application(
                           SimpleComposedText.parse(parts.Value[0]),
                           SimpleComposedText.parse(parts.Value[1])
                           ));
            } catch (System.Exception) {
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Parse the list of property values and build the property instance
        /// </summary>
        /// <param name="values">List of the lexemes of the values to init the property instance with</param>
        /// <returns>An instance of the property constructed with the values given</returns>
        public static IProperty Parse(List <string> values)
        {
            if (values.Count != 1)
            {
                return(null);
            }

            var value = values[0].Split(new[] { ':' }, 2);

            if (value.Length != 2)
            {
                return(null);
            }

            var flags = 0;

            try {
                flags = int.Parse(value[0]);
            } catch (System.Exception) { return(null); }

            var name = SimpleComposedText.parse(value[1]);

            return(new Figure(flags, name));
        }
Beispiel #3
0
 /// <summary>Initialize the property</summary>
 public Application(SimpleComposedText app, SimpleComposedText version)
 {
     this.app     = app;
     this.version = version;
 }
Beispiel #4
0
 /// <summary>Initialize the property</summary>
 public Figure(int flags, SimpleComposedText name)
 {
     _flags = flags;
     _name  = name;
 }