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


C# TypeMirror.GetMethodsByNameFlags方法代码示例

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


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

示例1: ResolveBreakpoints

		void ResolveBreakpoints (TypeMirror type)
		{
			var resolved = new List<BreakInfo> ();
			string typeName = type.FullName;
			Location loc;
			
			ProcessType (type);
			
			// First, resolve FunctionBreakpoints
			foreach (var bi in pending_bes.Where (b => b.BreakEvent is FunctionBreakpoint)) {
				var bp = (FunctionBreakpoint) bi.BreakEvent;
				int dot = bp.FunctionName.LastIndexOf ('.');
				string ftypeName = bp.FunctionName.Substring (0, dot);
				
				if (ftypeName == typeName) {
					string methodName = bp.FunctionName.Substring (dot + 1);
					
					foreach (var method in type.GetMethodsByNameFlags (methodName, BindingFlags.Default, false)) {
						if (!CheckMethodParams (method, bp.ParamTypes))
							continue;
						
						loc = GetLocFromMethod (method);
						if (loc != null) {
							string paramList = bp.ParamTypes != null ? "(" + string.Join (",", bp.ParamTypes) + ")" : "";
							OnDebuggerOutput (false, string.Format ("Resolved pending breakpoint for '{0}{1}' to {2}:{3} [0x{4:x5}].\n",
							                                        bp.FunctionName, paramList, loc.SourceFile, loc.LineNumber, loc.ILOffset));
							
							if (bp.ParamTypes == null)
								bp.ParamTypes = GetParamTypes (method);
							
							bp.SetResolvedFileName (loc.SourceFile);
							ResolvePendingBreakpoint (bi, loc);
							
							// Note: if the type or method is generic, there may be more instances so don't assume we are done resolving the breakpoint
							if (!type.IsGenericType && !IsGenericMethod (method))
								resolved.Add (bi);
							break;
						}
					}
				}
			}
			
			foreach (var be in resolved)
				pending_bes.Remove (be);
			resolved.Clear ();

			// Now resolve normal Breakpoints
			foreach (string s in type_to_source [type]) {
				foreach (var bi in pending_bes.Where (b => b.BreakEvent is Breakpoint)) {
					var bp = (Breakpoint) bi.BreakEvent;
					if (PathsAreEqual (PathToFileName (bp.FileName), s)) {
						bool insideLoadedRange;
						bool genericMethod;
						
						loc = GetLocFromType (type, s, bp.Line, out genericMethod, out insideLoadedRange);
						if (loc != null) {
							OnDebuggerOutput (false, string.Format ("Resolved pending breakpoint at '{0}:{1}' to {2} [0x{3:x5}].\n",
							                                        s, bp.Line, loc.Method.FullName, loc.ILOffset));
							ResolvePendingBreakpoint (bi, loc);
							
							// Note: if the type or method is generic, there may be more instances so don't assume we are done resolving the breakpoint
							if (!genericMethod && !type.IsGenericType)
								resolved.Add (bi);
						} else {
							if (insideLoadedRange) {
								bi.SetStatus (BreakEventStatus.Invalid, null);
							}
						}
					}
				}
				
				foreach (var be in resolved)
					pending_bes.Remove (be);
				resolved.Clear ();
			}
			
			// Thirdly, resolve pending catchpoints
			foreach (var bi in pending_bes.Where (b => b.BreakEvent is Catchpoint)) {
				var cp = (Catchpoint) bi.BreakEvent;
				if (cp.ExceptionName == typeName) {
					ResolvePendingCatchpoint (bi, type);
					resolved.Add (bi);
				}
			}
			
			foreach (var be in resolved)
				pending_bes.Remove (be);
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:88,代码来源:SoftDebuggerSession.cs


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