本文整理汇总了C#中System.Reflection.MemberInfo.GetMemberId方法的典型用法代码示例。如果您正苦于以下问题:C# MemberInfo.GetMemberId方法的具体用法?C# MemberInfo.GetMemberId怎么用?C# MemberInfo.GetMemberId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.MemberInfo
的用法示例。
在下文中一共展示了MemberInfo.GetMemberId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMemberDoc
public Entry GetMemberDoc(MemberInfo info)
{
if (info == null) return null;
Entry result;
if (!this.entries.TryGetValue(info.GetMemberId(), out result)) return null;
return result;
}
示例2: FromMember
public static HelpInfo FromMember(MemberInfo member)
{
if (member == null) return null;
XmlCodeDoc.Entry doc = HelpSystem.GetXmlCodeDoc(member);
if (doc != null)
{
HelpInfo info = new HelpInfo();
info.id = member.GetMemberId();
info.topic = member.Name;
info.desc = "";
if (doc.Summary != null) info.desc += doc.Summary;
if (doc.Remarks != null) info.desc += "\n\n" + doc.Remarks;
return info;
}
return CreateNotAvailable(member.Name);
}
示例3: Create
public static Entry Create(MemberInfo member)
{
EntryType entryType;
if (member is Type) entryType = EntryType.Type;
else if (member is FieldInfo) entryType = EntryType.Field;
else if (member is PropertyInfo) entryType = EntryType.Property;
else if (member is MethodInfo) entryType = EntryType.Method;
else if (member is ConstructorInfo) entryType = EntryType.Constructor;
else if (member is EventInfo) entryType = EntryType.Event;
else entryType = EntryType.Unknown;
if (member is Type)
return new Entry(entryType, (member as Type).GetTypeId(), member.GetMemberId());
else if (member != null)
return new Entry(entryType, member.DeclaringType.GetTypeId(), member.GetMemberId());
else
return null;
}