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


C# ProjectDom.GetSubclasses方法代码示例

本文整理汇总了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;
					}
				}
			}
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:39,代码来源:ReferencesFinder.cs

示例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;
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:16,代码来源:NSObjectInfoService.cs

示例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;
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:16,代码来源:WebTypeManager.cs


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