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


C# ITypeDefOrRef.ResolveTypeDef方法代码示例

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


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

示例1: BaseTypesEntryNode

		public BaseTypesEntryNode(ITypeDefOrRef tr, bool isInterface) {
			if (tr == null)
				throw new ArgumentNullException("tr");
			this.tr = tr;
			this.def = tr.ResolveTypeDef();
			this.isInterface = isInterface;
			this.LazyLoading = true;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:8,代码来源:BaseTypesEntryNode.cs

示例2: FindMethodCheckBaseType

        /// <summary>
        /// Find a MethodDef from a declaring type and some MethodData. Will generate
        /// a list of possible MethodSigs and check against each of them, returning the
        /// first-found MethodDef that matches the method name and signature.
        /// </summary>
        /// <param name="declaringType">Declaring type</param>
        /// <param name="data">MethodData</param>
        /// <param name="detectedSig">The detected MethodSig</param>
        /// <returns>MethodDef if found, null if none found</returns>
        MethodDef FindMethodCheckBaseType(ITypeDefOrRef declaringType, MethodData data, out MethodSig detectedSig)
        {
            detectedSig = null;

            TypeDef declaringDef = declaringType.ResolveTypeDef();
            if (declaringDef == null)
                return null;

            MethodDef method = null;
            MethodSig methodSig = GetMethodSig(data);
            var possibleSigs = PossibleMethodSigs(declaringType, methodSig, data);
            detectedSig = possibleSigs.FirstOrDefault(sig => {
                return (method = declaringDef.FindMethodCheckBaseType(data.Name, sig)) != null;
            });

            return method;
        }
开发者ID:3H54N,项目名称:eazdevirt,代码行数:26,代码来源:Resolver.cs

示例3: WriteToolTipWithClassInfo

        void WriteToolTipWithClassInfo(ITextOutput output, ITypeDefOrRef type)
        {
            var td = type.ResolveTypeDef();

            MethodDef invoke;
            if (IsDelegate(td) && (invoke = td.FindMethod("Invoke")) != null && invoke.MethodSig != null) {
                output.Write("delegate", TextTokenType.Keyword);
                output.WriteSpace();

                var writer = new MethodWriter(this, output, invoke);
                writer.WriteReturnType();

                // Always print the namespace here because that's what VS does. I.e., ignore
                // TOOLTIP_USE_NAMESPACES.
                WriteToolTipType(output, td, true);

                writer.WriteGenericArguments();
                writer.WriteMethodParameterList('(', ')');
                return;
            }

            if (td == null) {
                base.WriteToolTip(output, type, null);
                return;
            }

            string keyword;
            if (td.IsEnum)
                keyword = "enum";
            else if (td.IsValueType)
                keyword = "struct";
            else if (td.IsInterface)
                keyword = "interface";
            else
                keyword = "class";
            output.Write(keyword, TextTokenType.Keyword);
            output.WriteSpace();

            // Always print the namespace here because that's what VS does. I.e., ignore
            // TOOLTIP_USE_NAMESPACES.
            WriteToolTipType(output, type, true, false);
        }
开发者ID:se7ensoft,项目名称:dnSpy,代码行数:42,代码来源:CSharpLanguage.cs

示例4: DerivedTypesAnalysis

		public DerivedTypesAnalysis(ITypeDefOrRef type) {
			this.type = type;
			typeDef = type.ResolveTypeDef();
		}
开发者ID:mamingxiu,项目名称:dnExplorer,代码行数:4,代码来源:DerivedTypesAnalysis.cs

示例5: ResolveWithinSameModule

		static TypeDef ResolveWithinSameModule(ITypeDefOrRef type) {
			if (type != null && type.Scope == type.Module)
				return type.ResolveTypeDef();
			return null;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:5,代码来源:Helpers.cs

示例6: WriteToolTip

		void WriteToolTip(ITypeDefOrRef type) {
			var td = type.ResolveTypeDef();

			MethodDef invoke;
			if (IsDelegate(td) && (invoke = td.FindMethod("Invoke")) != null && invoke.MethodSig != null) {
				OutputWrite("delegate", TextTokenKind.Keyword);
				WriteSpace();

				var info = new MethodInfo(invoke);
				WriteModuleName(info);
				WriteReturnType(info);

				// Always print the namespace here because that's what VS does
				WriteType(td, true, ShowTypeKeywords);

				WriteGenericArguments(info);
				WriteMethodParameterList(info, "(", ")");
				return;
			}

			if (td == null) {
				Write(type);
				return;
			}

			string keyword;
			if (td.IsEnum)
				keyword = "enum";
			else if (td.IsValueType)
				keyword = "struct";
			else if (td.IsInterface)
				keyword = "interface";
			else
				keyword = "class";
			OutputWrite(keyword, TextTokenKind.Keyword);
			WriteSpace();

			// Always print the namespace here because that's what VS does
			WriteType(type, true, false);
		}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:40,代码来源:SimpleCSharpPrinter.cs


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