/// <summary>
	/// returns a 'ScriptMethods' object with the methods found
	/// in the passed object type
	/// </summary>
	protected ScriptMethods GetScriptMethods(object target)
	{

		ScriptMethods script;
		if (!m_StoredScriptTypes.TryGetValue(target.GetType(), out script))
		{
			script = new ScriptMethods(target.GetType());
			m_StoredScriptTypes.Add(target.GetType(), script);
		}
		return script;

	}
示例#2
0
        public static ScriptScopeContext CreateScope(Dictionary <string, object> args = null, ScriptMethods functions = null)
        {
            var context = new ScriptContext();

            if (functions != null)
            {
                context.ScriptMethods.Insert(0, functions);
            }

            context.Init();
            return(new ScriptScopeContext(new PageResult(context.EmptyPage), null, args));
        }