当前位置: 首页>>代码示例>>C#>>正文


C# VsaEngine.GetMainScope方法代码示例

本文整理汇总了C#中Microsoft.JScript.Vsa.VsaEngine.GetMainScope方法的典型用法代码示例。如果您正苦于以下问题:C# VsaEngine.GetMainScope方法的具体用法?C# VsaEngine.GetMainScope怎么用?C# VsaEngine.GetMainScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.JScript.Vsa.VsaEngine的用法示例。


在下文中一共展示了VsaEngine.GetMainScope方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Eval

	public override Object Eval(VsaEngine engine)
#line 97 "./Nodes/JExpr.tc"
	{
		IVariableAccess scope = (engine.ScriptObjectStackTop() as IVariableAccess);
		while(scope != null)
		{
			if(scope.HasVariable(name))
			{
				return scope.GetVariable(name);
			}
			scope = scope.GetParentScope();
		}
		return ((IVariableAccess)(engine.GetMainScope())).GetVariable(name);
	}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:14,代码来源:JNode.cs

示例2: GetAndPrepare

	public override Object GetAndPrepare(VsaEngine engine, ref Object data1, ref Object data2)
#line 130 "./Nodes/JExpr.tc"
	{
		IVariableAccess scope = (engine.ScriptObjectStackTop() as IVariableAccess);
		while(scope != null)
		{
			if(scope.HasVariable(name))
			{
				data1 = scope;
				return scope.GetVariable(name);
			}
			scope = scope.GetParentScope();
		}
		scope = (IVariableAccess)(engine.GetMainScope());
		data1 = scope;
		return scope.GetVariable(name);
	}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:17,代码来源:JNode.cs

示例3: Construct

	// Perform a constructor call on this object.
	internal override Object Construct(VsaEngine engine, Object[] args)
			{
				String parameters;
				String body;
				String defn;
				int index;
				JSParser parser;
				JFunction func;

				// Collect up the parameters and body.
				if(args.Length == 0)
				{
					parameters = String.Empty;
					body = String.Empty;
				}
				else if(args.Length == 1)
				{
					parameters = String.Empty;
					body = Convert.ToString(args[0]);
				}
				else
				{
					parameters = Convert.ToString(args[0]);
					for(index = 1; index < (args.Length - 1); ++index)
					{
						parameters =
							String.Concat(parameters, ",",
										  Convert.ToString(args[index]));
					}
					body = Convert.ToString(args[args.Length - 1]);
				}

				// Build a complete function definition and parse it.
				defn = "function (" + parameters + ") { " + body + " }";
				parser = new JSParser(new Context(defn));
				func = parser.ParseFunctionSource();

				// Build the function object and return it.
				return new FunctionObject
					(EngineInstance.GetEngineInstance(engine)
						.GetFunctionPrototype(), func,
					 engine.GetMainScope());
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:44,代码来源:FunctionConstructor.cs


注:本文中的Microsoft.JScript.Vsa.VsaEngine.GetMainScope方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。