• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Soft.MethodMirror类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mono.Debugger.Soft.MethodMirror的典型用法代码示例。如果您正苦于以下问题:C# MethodMirror类的具体用法?C# MethodMirror怎么用?C# MethodMirror使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MethodMirror类属于Mono.Debugger.Soft命名空间,在下文中一共展示了MethodMirror类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PropertyValueReference

		public PropertyValueReference (EvaluationContext ctx, PropertyInfoMirror property, object obj, TypeMirror declaringType, MethodMirror getter, Value[] indexerArgs): base (ctx)
		{
			this.property = property;
			this.obj = obj;
			this.declaringType = declaringType;
			this.indexerArgs = indexerArgs;
			
			flags = ObjectValueFlags.Property;
			if (property.GetSetMethod (true) == null)
				flags |= ObjectValueFlags.ReadOnly;
			
			if (getter.IsStatic)
				flags |= ObjectValueFlags.Global;
			if (getter.IsPublic)
				flags |= ObjectValueFlags.Public;
			else if (getter.IsPrivate)
				flags |= ObjectValueFlags.Private;
			else if (getter.IsFamily)
				flags |= ObjectValueFlags.Protected;
			else if (getter.IsFamilyAndAssembly)
				flags |= ObjectValueFlags.Internal;
			else if (getter.IsFamilyOrAssembly)
				flags |= ObjectValueFlags.InternalProtected;
			
			if (property.DeclaringType.IsValueType)
				flags |= ObjectValueFlags.ReadOnly; // Setting property values on structs is not supported by sdb
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:27,代码来源:PropertyValueReference.cs


示例2: GetFlags

		internal static ObjectValueFlags GetFlags (PropertyInfoMirror property, MethodMirror getter)
		{
			var flags = ObjectValueFlags.Property;

			if (property.GetSetMethod (true) == null)
				flags |= ObjectValueFlags.ReadOnly;

			if (getter.IsStatic)
				flags |= ObjectValueFlags.Global;

			if (getter.IsPublic)
				flags |= ObjectValueFlags.Public;
			else if (getter.IsPrivate)
				flags |= ObjectValueFlags.Private;
			else if (getter.IsFamily)
				flags |= ObjectValueFlags.Protected;
			else if (getter.IsFamilyAndAssembly)
				flags |= ObjectValueFlags.Internal;
			else if (getter.IsFamilyOrAssembly)
				flags |= ObjectValueFlags.InternalProtected;

			if (property.DeclaringType.IsValueType)
				flags |= ObjectValueFlags.ReadOnly; // Setting property values on structs is not supported by sdb

			return flags;
		}
开发者ID:transformersprimeabcxyz,项目名称:debugger-libs,代码行数:26,代码来源:PropertyValueReference.cs


示例3: PropertyInfoMirror

		public PropertyInfoMirror (TypeMirror parent, long id, string name, MethodMirror get_method, MethodMirror set_method, PropertyAttributes attrs) : base (parent.VirtualMachine, id) {
			this.parent = parent;
			this.name = name;
			this.attrs = attrs;
			this.get_method = get_method;
			this.set_method = set_method;
		}
开发者ID:shana,项目名称:Mono.Debugger.Soft,代码行数:7,代码来源:PropertyInfoMirror.cs


示例4: ParameterInfoMirror

		internal ParameterInfoMirror (MethodMirror method, int pos, TypeMirror type, string name, ParameterAttributes attrs) : base (method.VirtualMachine, 0) {
			this.method = method;
			this.pos = pos;
			this.type = type;
			this.name = name;
			this.attrs = attrs;
		}
开发者ID:0xb1dd1e,项目名称:debugger-libs,代码行数:7,代码来源:ParameterInfoMirror.cs


示例5: Location

		//int column_number;
		
		internal Location (VirtualMachine vm, MethodMirror method, long native_addr, int il_offset, string source_file, int line_number, int column_number) : base (vm, 0) {
			this.method = method;
			//this.native_addr = native_addr;
			this.il_offset = il_offset;
			this.source_file = source_file;
			this.line_number = line_number;
			//this.column_number = column_number;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:10,代码来源:Location.cs


示例6: StackFrame

 /*
  * FIXME: Decide on the way to request/handle debugging information:
  * - request the info in bulk for all frames/on demand for individual frames
  * - request the info from the runtime/request only the il offset, and compute
  *   everything else based on this info using the method debug info.
  */
 internal StackFrame(VirtualMachine vm, long id, ThreadMirror thread, MethodMirror method, int il_offset, StackFrameFlags flags)
     : base(vm, id)
 {
     this.thread = thread;
     this.method = method;
     this.il_offset = il_offset;
     this.flags = flags;
 }
开发者ID:peterdocter,项目名称:debugger-libs,代码行数:14,代码来源:StackFrame.cs


示例7: BreakpointEventRequest

		internal BreakpointEventRequest (VirtualMachine vm, MethodMirror method, long location) : base (vm, EventType.Breakpoint) {
			if (method == null)
				throw new ArgumentNullException ("method");
			CheckMirror (vm, method);
			if (method.Locations.Count > 0 && !method.Locations.Any (l => l.ILOffset == location))
				throw new ArgumentException ("A breakpoint can only be set at an IL offset which is equal to the ILOffset property of one of the locations in method.Locations", "location");
			this.method = method;
			this.location = location;
		}
开发者ID:shana,项目名称:Mono.Debugger.Soft,代码行数:9,代码来源:BreakpointEventRequest.cs


示例8: PropertyValueReference

		public PropertyValueReference (EvaluationContext ctx, PropertyInfoMirror property, object obj, TypeMirror declaringType, MethodMirror getter, Value[] indexerArgs): base (ctx)
		{
			this.property = property;
			this.obj = obj;
			this.declaringType = declaringType;
			this.indexerArgs = indexerArgs;
			
			flags = GetFlags (property, getter);
		}
开发者ID:0xb1dd1e,项目名称:debugger-libs,代码行数:9,代码来源:PropertyValueReference.cs


示例9: LocalVariable

	    internal LocalVariable (VirtualMachine vm, MethodMirror method, int index, long type_id, string name, int live_range_start, int live_range_end, bool is_arg) : base (vm, 0) {
			this.method = method;
			this.index = index;
			this.name = name;
			this.type_id = type_id;
			this.is_arg = is_arg;
			this.live_range_start = live_range_start;
			this.live_range_end = live_range_end;
		}
开发者ID:0xb1dd1e,项目名称:debugger-libs,代码行数:9,代码来源:LocalVariable.cs


示例10: PropertyValueReference

		public PropertyValueReference (EvaluationContext ctx, PropertyInfoMirror property, object obj, TypeMirror declaringType, MethodMirror getter, Value[] indexerArgs): base (ctx)
		{
			this.declaringType = declaringType;
			this.indexerArgs = indexerArgs;
			this.property = property;
			this.getter = getter;
			this.obj = obj;

			var objectMirror = obj as ObjectMirror;
			if (objectMirror != null)
				EnsureContextHasDomain (objectMirror.Domain);

			flags = GetFlags (property, getter);
		}
开发者ID:transformersprimeabcxyz,项目名称:debugger-libs,代码行数:14,代码来源:PropertyValueReference.cs


示例11: GetILOffset

        internal static StatementRange GetILOffset(MonoPendingBreakpoint bp, MethodMirror methodMirror, out int ilOffset)
        {
            List<Mono.Debugger.Soft.Location> locations = methodMirror.Locations.ToList();

            foreach (Mono.Debugger.Soft.Location location in locations)
            {
                int line = location.LineNumber;
                int column = location.ColumnNumber;

                if (line != bp.StartLine + 1)
                    continue;
                //if (column != bp.StartColumn)
                //    continue;

                ilOffset = location.ILOffset;

                Console.WriteLine(location.ColumnNumber);
                return null;
            }

            throw new Exception("Cant bind breakpoint");
        }
开发者ID:nakioman,项目名称:MonoDebugger,代码行数:22,代码来源:RoslynHelper.cs


示例12: InvokeMethod

		internal static Value InvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options) {
			return EndInvokeMethodInternal (BeginInvokeMethod (vm, thread, method, this_obj, arguments, options, null, null));
		}
开发者ID:xzkmxd,项目名称:mono,代码行数:3,代码来源:ObjectMirror.cs


示例13: BeginInvokeMethod

		internal static IInvokeAsyncResult BeginInvokeMethod (VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList<Value> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			if (thread == null)
				throw new ArgumentNullException ("thread");
			if (method == null)
				throw new ArgumentNullException ("method");
			if (arguments == null)
				arguments = new Value [0];

			InvokeFlags f = InvokeFlags.NONE;

			if ((options & InvokeOptions.DisableBreakpoints) != 0)
				f |= InvokeFlags.DISABLE_BREAKPOINTS;
			if ((options & InvokeOptions.SingleThreaded) != 0)
				f |= InvokeFlags.SINGLE_THREADED;
			if ((options & InvokeOptions.ReturnOutThis) != 0)
				f |= InvokeFlags.OUT_THIS;
			if ((options & InvokeOptions.ReturnOutArgs) != 0)
				f |= InvokeFlags.OUT_ARGS;

			InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
			thread.InvalidateFrames ();
			r.ID = vm.conn.VM_BeginInvokeMethod (thread.Id, method.Id, this_obj != null ? vm.EncodeValue (this_obj) : vm.EncodeValue (vm.CreateValue (null)), vm.EncodeValues (arguments), f, InvokeCB, r);

			return r;
		}
开发者ID:xzkmxd,项目名称:mono,代码行数:25,代码来源:ObjectMirror.cs


示例14: BeginInvokeMultiple

		//
		// Invoke the members of METHODS one-by-one, calling CALLBACK after each invoke was finished. The IAsyncResult will be marked as completed after all invokes have
		// finished. The callback will be called with a different IAsyncResult that represents one method invocation.
		// From protocol version 2.22.
		//
		public IAsyncResult BeginInvokeMultiple (ThreadMirror thread, MethodMirror[] methods, IList<IList<Value>> arguments, InvokeOptions options, AsyncCallback callback, object state) {
			return BeginInvokeMultiple (vm, thread, methods, this, arguments, options, callback, state);
		}
开发者ID:xzkmxd,项目名称:mono,代码行数:8,代码来源:ObjectMirror.cs


示例15: InvokeMethodAsyncWithResult

		public Task<InvokeResult> InvokeMethodAsyncWithResult (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options = InvokeOptions.None) {
			var tcs = new TaskCompletionSource<InvokeResult> ();
			BeginInvokeMethod (thread, method, arguments, options, iar =>
					{
						try {
							tcs.SetResult (EndInvokeMethodInternalWithResult (iar));
						} catch (OperationCanceledException) {
							tcs.TrySetCanceled ();
						} catch (Exception ex) {
							tcs.TrySetException (ex);
						}
					}, null);
			return tcs.Task;
		}
开发者ID:xzkmxd,项目名称:mono,代码行数:14,代码来源:ObjectMirror.cs


示例16: GetMethodsByNameFlags

		public MethodMirror[] GetMethodsByNameFlags (string name, BindingFlags flags, bool ignoreCase) {
			if (vm.conn.Version.AtLeast (2, 6)) {
				long[] ids = vm.conn.Type_GetMethodsByNameFlags (id, name, (int)flags, ignoreCase);
				MethodMirror[] m = new MethodMirror [ids.Length];
				for (int i = 0; i < ids.Length; ++i)
					m [i] = vm.GetMethod (ids [i]);
				return m;
			} else {
				if ((flags & BindingFlags.IgnoreCase) != 0) {
					flags &= ~BindingFlags.IgnoreCase;
					ignoreCase = true;
				}
				
				if (flags == BindingFlags.Default)
					flags = BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.Static;
				
				MethodAttributes access = (MethodAttributes) 0;
				bool matchInstance = false;
				bool matchStatic = false;
				
				if ((flags & BindingFlags.NonPublic) != 0) {
					access |= MethodAttributes.Private;
					flags &= ~BindingFlags.NonPublic;
				}
				if ((flags & BindingFlags.Public) != 0) {
					access |= MethodAttributes.Public;
					flags &= ~BindingFlags.Public;
				}
				if ((flags & BindingFlags.Instance) != 0) {
					flags &= ~BindingFlags.Instance;
					matchInstance = true;
				}
				if ((flags & BindingFlags.Static) != 0) {
					flags &= ~BindingFlags.Static;
					matchStatic = true;
				}
				
				if ((int) flags != 0)
					throw new NotImplementedException ();
				
				var res = new List<MethodMirror> ();
				foreach (MethodMirror m in GetMethods ()) {
					if ((m.Attributes & access) == (MethodAttributes) 0)
						continue;
					
					if (!((matchStatic && m.IsStatic) || (matchInstance && !m.IsStatic)))
						continue;
					
					if ((!ignoreCase && m.Name == name) || (ignoreCase && m.Name.Equals (name, StringComparison.CurrentCultureIgnoreCase)))
						res.Add (m);
				}
				return res.ToArray ();
			}
		}
开发者ID:ming871,项目名称:NoahGameFrame,代码行数:54,代码来源:TypeMirror.cs


示例17: RuntimeInvoke

		public Value RuntimeInvoke (MethodMirror method, object target, Value[] values)
		{
			if (values != null) {
				// Some arguments may need to be boxed
				var mparams = method.GetParameters ();
				if (mparams.Length != values.Length)
					throw new EvaluatorException ("Invalid number of arguments when calling: " + method.Name);
				
				for (int n = 0; n < mparams.Length; n++) {
					var tm = mparams[n].ParameterType;
					if (tm.IsValueType || tm.IsPrimitive)
						continue;

					var type = Adapter.GetValueType (this, values[n]);
					var argTypeMirror = type as TypeMirror;
					var argType = type as Type;

					if (IsValueTypeOrPrimitive (argTypeMirror) || IsValueTypeOrPrimitive (argType)) {
						// A value type being assigned to a parameter which is not a value type. The value has to be boxed.
						try {
							values[n] = Thread.Domain.CreateBoxedValue (values [n]);
						} catch (NotSupportedException) {
							// This runtime doesn't support creating boxed values
							throw new EvaluatorException ("This runtime does not support creating boxed values.");
						}
					}
				}
			}

			if (!method.IsStatic && method.DeclaringType.IsClass && !IsValueTypeOrPrimitive (method.DeclaringType)) {
				object type = Adapter.GetValueType (this, target);
				var targetTypeMirror = type as TypeMirror;
				var targetType = type as Type;

				if ((target is StructMirror && ((StructMirror) target).Type != method.DeclaringType) ||
				    (IsValueTypeOrPrimitive (targetTypeMirror) || IsValueTypeOrPrimitive (targetType))) {
					// A value type being assigned to a parameter which is not a value type. The value has to be boxed.
					try {
						target = Thread.Domain.CreateBoxedValue ((Value) target);
					} catch (NotSupportedException) {
						// This runtime doesn't support creating boxed values
						throw new EvaluatorException ("This runtime does not support creating boxed values.");
					}
				}
			}

			try {
				return method.Evaluate (target is TypeMirror ? null : (Value) target, values);
			} catch (NotSupportedException) {
				AssertTargetInvokeAllowed ();

				var mc = new MethodCall (this, method, target, values);
				Adapter.AsyncExecute (mc, Options.EvaluationTimeout);

				return mc.ReturnValue;
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:debugger-libs,代码行数:57,代码来源:SoftEvaluationContext.cs


示例18: MethodBodyMirror

		internal MethodBodyMirror (VirtualMachine vm, MethodMirror method, MethodBodyInfo info) : base (vm, 0) {
			this.method = method;
			this.info = info;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:4,代码来源:MethodBodyMirror.cs


示例19: InvokeMethod

		public Value InvokeMethod (ThreadMirror thread, MethodMirror method, IList<Value> arguments) {
			return ObjectMirror.InvokeMethod (vm, thread, method, this, arguments, InvokeOptions.None);
		}
开发者ID:sparek,项目名称:monodevelop,代码行数:3,代码来源:PrimitiveValue.cs


示例20: NewInstance

		public Value NewInstance (ThreadMirror thread, MethodMirror method, IList<Value> arguments, InvokeOptions options) {
			return ObjectMirror.InvokeMethod (vm, thread, method, null, arguments, options);
		}
开发者ID:nestalk,项目名称:mono,代码行数:3,代码来源:TypeMirror.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Soft.ThreadMirror类代码示例发布时间:2022-05-26
下一篇:
C# Frontend.ScriptingContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap