本文整理汇总了C#中MonoDevelop.Projects.Dom.Parser.ProjectDom.GetSubclasses方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectDom.GetSubclasses方法的具体用法?C# ProjectDom.GetSubclasses怎么用?C# ProjectDom.GetSubclasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.Projects.Dom.Parser.ProjectDom
的用法示例。
在下文中一共展示了ProjectDom.GetSubclasses方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectMembers
internal static IEnumerable<INode> CollectMembers (ProjectDom dom, IMember member)
{
if (member is IMethod && ((IMethod)member).IsConstructor) {
yield return member;
} else {
bool isOverrideable = member.DeclaringType.ClassType == ClassType.Interface || member.IsOverride || member.IsVirtual || member.IsAbstract;
bool isLastMember = false;
// for members we need to collect the whole 'class' of members (overloads & implementing types)
HashSet<string> alreadyVisitedTypes = new HashSet<string> ();
foreach (IType type in dom.GetInheritanceTree (member.DeclaringType)) {
if (type.ClassType == ClassType.Interface || isOverrideable || type.DecoratedFullName == member.DeclaringType.DecoratedFullName) {
// search in the class for the member
foreach (IMember interfaceMember in type.SearchMember (member.Name, true)) {
if (interfaceMember.MemberType == member.MemberType)
yield return interfaceMember;
}
// now search in all subclasses of this class for the member
isLastMember = !member.IsOverride;
foreach (IType implementingType in dom.GetSubclasses (type)) {
string name = implementingType.DecoratedFullName;
if (alreadyVisitedTypes.Contains (name))
continue;
alreadyVisitedTypes.Add (name);
foreach (IMember typeMember in implementingType.SearchMember (member.Name, true)) {
if (typeMember.MemberType == member.MemberType) {
isLastMember = type.ClassType != ClassType.Interface && (typeMember.IsVirtual || typeMember.IsAbstract || !typeMember.IsOverride);
yield return typeMember;
}
}
if (!isOverrideable)
break;
}
if (isLastMember)
break;
}
}
}
}
示例2: GetRegisteredObjects
internal IEnumerable<NSObjectTypeInfo> GetRegisteredObjects (ProjectDom dom)
{
var nso = dom.GetType (nsobjectType);
if (nso == null)
throw new Exception ("Could not get NSObject from type database");
//FIXME: only emit this for the wrapper NS
yield return new NSObjectTypeInfo ("NSObject", nsobjectType.FullName, null, null, false, false, false);
foreach (var type in dom.GetSubclasses (nso, false)) {
var info = ConvertType (dom, type);
if (info != null)
yield return info;
}
}
示例3: ListControlClasses
public static IEnumerable<IType> ListControlClasses (IType baseType, ProjectDom database, string namespac)
{
if (database == null)
yield break;
//return classes if they derive from system.web.ui.control
foreach (IType type in database.GetSubclasses (baseType, false, new string [] {namespac}))
if (!type.IsAbstract && type.IsPublic)
yield return type;
if (!baseType.IsAbstract && baseType.IsPublic && baseType.Namespace == namespac) {
IType t = database.GetType (baseType.FullName);
if (t != null)
yield return baseType;
}
}