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; }
/// <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); }
public PossibleObjectHandler(string name, Type type, TryParseTo parseMethod) { Name = name; Type = type; ParseMethod = parseMethod; }