/// <summary>
        /// Extracts the properties from a running script
        /// </summary>
        /// <param name="script">The script to extract from</param>
        public static ScriptProperty[] ExtractProperties(Script script)
        {
            var globals    = script.Globals;
            var keys       = script.Globals.Keys;
            var properties = new List <ScriptProperty> ();

            foreach (var key in keys)
            {
                var value = globals.Get(key);
                var name  = key.String.Replace("\"", "");

                if (ignoreSet.Contains(name))
                {
                    continue;
                }

                var property = new ScriptProperty();
                property.name = name;

                var isValidProperty = true;

                switch (value.Type)
                {
                case DataType.Boolean:
                    property.value = value.Boolean.ToString();
                    property.type  = PropertyType.Boolean;
                    break;

                case DataType.Number:
                    property.value = value.Number.ToString();
                    property.type  = PropertyType.Number;
                    break;

                case DataType.String:
                    property.value = value.String;
                    property.type  = PropertyType.String;
                    break;

                default:
                    isValidProperty = false;
                    break;
                }

                if (isValidProperty)
                {
                    properties.Add(property);
                }
            }

            return(properties.ToArray());
        }
        /// <summary>
        /// Extracts script properties from json data
        /// </summary>
        private ScriptProperty[] ExtractScriptProperties(JsonData data)
        {
            var props = new ScriptProperty[data.Count];

            for (var i = 0; i < props.Length; ++i)
            {
                var datum = data[i];

                var prop = new ScriptProperty {
                    name  = datum["name"].GetString(),
                    value = datum["value"].GetString(),
                    type  = (PropertyType)(int)datum["type"]
                };

                props[i] = prop;
            }

            return(props);
        }