Proxy class to implement debug interfaces without bloat of class files.
Proxy class to implement debug interfaces without bloat of class files.
Inheritance: ContextAction, ContextFactory.Listener, Rhino.Debug.Debugger
示例#1
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Returns the value of a property on the given script object.</summary>
		/// <remarks>Returns the value of a property on the given script object.</remarks>
		public virtual object GetObjectProperty(object @object, object id)
		{
			Dim.DimIProxy action = new Dim.DimIProxy(this, IPROXY_OBJECT_PROPERTY);
			action.@object = @object;
			action.id = id;
			action.WithContext();
			return action.objectResult;
		}
示例#2
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Returns an array of the property names on the given script object.</summary>
		/// <remarks>Returns an array of the property names on the given script object.</remarks>
		public virtual object[] GetObjectIds(object @object)
		{
			Dim.DimIProxy action = new Dim.DimIProxy(this, IPROXY_OBJECT_IDS);
			action.@object = @object;
			action.WithContext();
			return action.objectArrayResult;
		}
示例#3
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Converts the given script object to a string.</summary>
		/// <remarks>Converts the given script object to a string.</remarks>
		public virtual string ObjectToString(object @object)
		{
			Dim.DimIProxy action = new Dim.DimIProxy(this, IPROXY_OBJECT_TO_STRING);
			action.@object = @object;
			action.WithContext();
			return action.stringResult;
		}
示例#4
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Returns whether the given string is syntactically valid script.</summary>
		/// <remarks>Returns whether the given string is syntactically valid script.</remarks>
		public virtual bool StringIsCompilableUnit(string str)
		{
			Dim.DimIProxy action = new Dim.DimIProxy(this, IPROXY_STRING_IS_COMPILABLE);
			action.text = str;
			action.WithContext();
			return action.booleanResult;
		}
示例#5
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Evaluates the given script.</summary>
		/// <remarks>Evaluates the given script.</remarks>
		public virtual void EvalScript(string url, string text)
		{
			Dim.DimIProxy action = new Dim.DimIProxy(this, IPROXY_EVAL_SCRIPT);
			action.url = url;
			action.text = text;
			action.WithContext();
		}
示例#6
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Compiles the given script.</summary>
		/// <remarks>Compiles the given script.</remarks>
		public virtual void CompileScript(string url, string text)
		{
			Dim.DimIProxy action = new Dim.DimIProxy(this, IPROXY_COMPILE_SCRIPT);
			action.url = url;
			action.text = text;
			action.WithContext();
		}
示例#7
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Detaches the debugger from the current ContextFactory.</summary>
		/// <remarks>Detaches the debugger from the current ContextFactory.</remarks>
		public virtual void Detach()
		{
			if (listener != null)
			{
				contextFactory.RemoveListener(listener);
				contextFactory = null;
				listener = null;
			}
		}
示例#8
0
文件: Dim.cs 项目: hazzik/Rhino.Net
		/// <summary>Attaches the debugger to the given ContextFactory.</summary>
		/// <remarks>Attaches the debugger to the given ContextFactory.</remarks>
		public virtual void AttachTo(ContextFactory factory)
		{
			Detach();
			this.contextFactory = factory;
			this.listener = new Dim.DimIProxy(this, IPROXY_LISTEN);
			factory.AddListener(this.listener);
		}
示例#9
0
文件: Dim.cs 项目: hazzik/Rhino.Net
			// 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);
			}