本文整理匯總了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;
}
}