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


C# Context.SetOptimizationLevel方法代码示例

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


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

示例1: OnContextCreated

		protected internal override void OnContextCreated(Context cx)
		{
			cx.SetLanguageVersion(languageVersion);
			cx.SetOptimizationLevel(optimizationLevel);
			if (errorReporter != null)
			{
				cx.SetErrorReporter(errorReporter);
			}
			cx.SetGeneratingDebug(generatingDebug);
			base.OnContextCreated(cx);
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:11,代码来源:ShellContextFactory.cs

示例2: ContextCreated

			// ContextFactory.Listener
			/// <summary>Called when a Context is created.</summary>
			/// <remarks>Called when a Context is created.</remarks>
			public virtual void ContextCreated(Context cx)
			{
				if (type != IPROXY_LISTEN)
				{
					Kit.CodeBug();
				}
				Dim.ContextData contextData = new Dim.ContextData();
				Rhino.Debug.Debugger debugger = new Dim.DimIProxy(dim, IPROXY_DEBUG);
				cx.SetDebugger(debugger, contextData);
				cx.SetGeneratingDebug(true);
				cx.SetOptimizationLevel(-1);
			}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:15,代码来源:Dim.cs

示例3: Do_eval

		/// <summary>Evaluates script in the given stack frame.</summary>
		/// <remarks>Evaluates script in the given stack frame.</remarks>
		private static string Do_eval(Context cx, Dim.StackFrame frame, string expr)
		{
			string resultString;
			Rhino.Debug.Debugger saved_debugger = cx.GetDebugger();
			object saved_data = cx.GetDebuggerContextData();
			int saved_level = cx.GetOptimizationLevel();
			cx.SetDebugger(null, null);
			cx.SetOptimizationLevel(-1);
			cx.SetGeneratingDebug(false);
			try
			{
				Callable script = (Callable)cx.CompileString(expr, string.Empty, 0, null);
				object result = script.Call(cx, frame.scope, frame.thisObj, ScriptRuntime.emptyArgs);
				if (result == Undefined.instance)
				{
					resultString = string.Empty;
				}
				else
				{
					resultString = ScriptRuntime.ToString(result);
				}
			}
			catch (Exception exc)
			{
				resultString = exc.Message;
			}
			finally
			{
				cx.SetGeneratingDebug(true);
				cx.SetOptimizationLevel(saved_level);
				cx.SetDebugger(saved_debugger, saved_data);
			}
			if (resultString == null)
			{
				resultString = "null";
			}
			return resultString;
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:40,代码来源:Dim.cs

示例4: Run

			public object Run(Context context)
			{
				context.SetOptimizationLevel(optimizationLevel);
				return Context.ToString(action.Run(context));
			}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:5,代码来源:TypeOfTest.cs

示例5: SetUp

		public virtual void SetUp()
		{
			cx = Context.Enter();
			cx.SetOptimizationLevel(-1);
			scope = cx.InitStandardObjects();
		}
开发者ID:hazzik,项目名称:Rhino.Net,代码行数:6,代码来源:Bug685403Test.cs


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