本文整理汇总了C#中INamespace.GetMembers方法的典型用法代码示例。如果您正苦于以下问题:C# INamespace.GetMembers方法的具体用法?C# INamespace.GetMembers怎么用?C# INamespace.GetMembers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INamespace
的用法示例。
在下文中一共展示了INamespace.GetMembers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectAllMembers
private static void CollectAllMembers(List<IEntity> members, INamespace entity)
{
var type = entity as IType;
if (null != type)
{
members.ExtendUnique(type.GetMembers());
CollectBaseTypeMembers(members, type.BaseType);
}
else
{
members.Extend(entity.GetMembers());
}
}
示例2: FlattenChildNamespaces
private static void FlattenChildNamespaces(List<INamespace> list, INamespace ns)
{
foreach (IEntity ent in ns.GetMembers())
{
if (EntityType.Namespace != ent.EntityType) continue;
list.Add((INamespace) ent);
FlattenChildNamespaces(list, (INamespace) ent);
}
}
示例3: GetAllMembers
private static void GetAllMembers(List members, INamespace entity)
{
if (null == entity) return;
IType type = entity as IType;
if (null != type)
{
members.ExtendUnique(type.GetMembers());
GetAllMembers(members, type.BaseType);
}
else
{
members.Extend(entity.GetMembers());
}
}
示例4: GetMostSimilarMemberName
public string GetMostSimilarMemberName(INamespace ns, string name, EntityType elementType)
{
if (null == ns) return null;
string expectedSoundex = ToSoundex(name);
string lastMemberName = null;
foreach (IEntity member in ns.GetMembers())
{
if (EntityType.Any != elementType && elementType != member.EntityType)
continue;
if (lastMemberName == member.Name)
continue;//no need to check this name again
//TODO: try Levenshtein distance or Metaphone instead of Soundex.
if (expectedSoundex == ToSoundex(member.Name))
{
return member.Name;
}
lastMemberName = member.Name;
}
return null;
}