Пример #1
0
 public ScriptObjectType(string name, Type typeofIt, TryParseTo method, object defaultValue = null)
 {
     Handler = new PossibleObjectHandler(name, typeofIt, method);
     if (!StringUtils.Possibles.Contains(Handler))
     {
         StringUtils.Possibles.Add(Handler);
     }
     DefaultValue = defaultValue;
 }
Пример #2
0
        /// <summary>
        /// Adds the type of the object.
        /// </summary>
        /// <param name="name">Name of the object.</param>
        /// <param name="type">Type of the object.</param>
        /// <param name="parseMethod">Parse method for string to object conversion.</param>
        /// <param name="defaultValue">Default value for this object.</param>
        public static void AddObjectType(string name, Type type, TryParseTo parseMethod, object defaultValue = null)
        {
            var objType = new ScriptObjectType(name, type, parseMethod, defaultValue);

            CODE_INFO.AddPossible(objType);
        }
Пример #3
0
 public PossibleObjectHandler(string name, Type type, TryParseTo parseMethod)
 {
     Name        = name;
     Type        = type;
     ParseMethod = parseMethod;
 }