Beispiel #1
0
        /// <summary>
        /// Gets all base types.
        /// </summary>
        /// <remarks>This is the reflexive and transitive closure of <see cref="IType.DirectBaseTypes"/>.
        /// Note that this method does not return all supertypes - doing so is impossible due to contravariance
        /// (and undesirable for covariance as the list could become very large).
        ///
        /// The output is ordered so that base types occur before derived types.
        /// </remarks>
        public static IEnumerable <IType> GetAllBaseTypes(this IType type)
        {
            BaseTypeCollector collector = new BaseTypeCollector();

            collector.CollectBaseTypes(type);
            return(collector);
        }
Beispiel #2
0
		/// <summary>
		/// Gets all non-interface base types.
		/// </summary>
		/// <remarks>
		/// When <paramref name="type"/> is an interface, this method will also return base interfaces (return same output as GetAllBaseTypes()).
		/// 
		/// The output is ordered so that base types occur before derived types.
		/// </remarks>
		public static IEnumerable<IType> GetNonInterfaceBaseTypes(this IType type)
		{
			BaseTypeCollector collector = new BaseTypeCollector();
			collector.SkipImplementedInterfaces = true;
			collector.CollectBaseTypes(type);
			return collector;
		}
Beispiel #3
0
        /// <summary>
        /// Gets all base types.
        /// </summary>
        /// <remarks>This is the reflexive and transitive closure of <see cref="IType.GetBaseTypes"/>.
        /// Note that this method does not return all supertypes - doing so is impossible due to contravariance
        /// (and undesirable for covariance as the list could become very large).
        ///
        /// The output is ordered so that base types occur in before derived types.
        /// </remarks>
        public static IEnumerable <IType> GetAllBaseTypes(this IType type, ITypeResolveContext context)
        {
            BaseTypeCollector collector = new BaseTypeCollector(context);

            collector.CollectBaseTypes(type);
            return(collector);
        }
Beispiel #4
0
        /// <summary>
        /// Gets all non-interface base types.
        /// </summary>
        /// <remarks>
        /// When <paramref name="type"/> is an interface, this method will also return base interfaces (return same output as GetAllBaseTypes()).
        ///
        /// The output is ordered so that base types occur before derived types.
        /// </remarks>
        public static IEnumerable <IType> GetNonInterfaceBaseTypes(this IType type)
        {
            BaseTypeCollector collector = new BaseTypeCollector();

            collector.SkipImplementedInterfaces = true;
            collector.CollectBaseTypes(type);
            return(collector);
        }
		/// <summary>
		/// Gets all base types.
		/// </summary>
		/// <remarks>This is the reflexive and transitive closure of <see cref="IType.DirectBaseTypes"/>.
		/// Note that this method does not return all supertypes - doing so is impossible due to contravariance
		/// (and undesirable for covariance as the list could become very large).
		/// 
		/// The output is ordered so that base types occur before derived types.
		/// </remarks>
		public static IEnumerable<IType> GetAllBaseTypes(this IType type)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			BaseTypeCollector collector = new BaseTypeCollector();
			collector.CollectBaseTypes(type);
			return collector;
		}
		/// <summary>
		/// Gets all base types.
		/// </summary>
		/// <remarks>This is the reflexive and transitive closure of <see cref="IType.DirectBaseTypes"/>.
		/// Note that this method does not return all supertypes - doing so is impossible due to contravariance
		/// (and undesirable for covariance as the list could become very large).
		/// 
		/// The output is ordered so that base types occur before derived types.
		/// </remarks>
		public static IEnumerable<IType> GetAllBaseTypes(this IType type)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			BaseTypeCollector collector = new BaseTypeCollector();
			collector.CollectBaseTypes(type);
			return collector;
		}
		/// <summary>
		/// Gets all non-interface base types.
		/// </summary>
		/// <remarks>
		/// When <paramref name="type"/> is an interface, this method will also return base interfaces (return same output as GetAllBaseTypes()).
		/// 
		/// The output is ordered so that base types occur before derived types.
		/// </remarks>
		public static IEnumerable<IType> GetNonInterfaceBaseTypes(this IType type)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			BaseTypeCollector collector = new BaseTypeCollector();
			collector.SkipImplementedInterfaces = true;
			collector.CollectBaseTypes(type);
			return collector;
		}
		/// <summary>
		/// Gets all non-interface base types.
		/// </summary>
		/// <remarks>
		/// When <paramref name="type"/> is an interface, this method will also return base interfaces (return same output as GetAllBaseTypes()).
		/// 
		/// The output is ordered so that base types occur before derived types.
		/// </remarks>
		public static IEnumerable<IType> GetNonInterfaceBaseTypes(this IType type)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			BaseTypeCollector collector = new BaseTypeCollector();
			collector.SkipImplementedInterfaces = true;
			collector.CollectBaseTypes(type);
			return collector;
		}
Beispiel #9
0
        /// <summary>
        /// Gets all base types.
        /// </summary>
        /// <remarks>This is the reflexive and transitive closure of <see cref="IType.DirectBaseTypes"/>.
        /// Note that this method does not return all supertypes - doing so is impossible due to contravariance
        /// (and undesirable for covariance as the list could become very large).
        ///
        /// The output is ordered so that base types occur before derived types.
        /// </remarks>
        public static IEnumerable <IType> GetAllBaseTypes(this IType type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            BaseTypeCollector collector = new BaseTypeCollector();

            collector.CollectBaseTypes(type);
            return(collector);
        }
Beispiel #10
0
		/// <summary>
		/// Gets all base types.
		/// </summary>
		/// <remarks>This is the reflexive and transitive closure of <see cref="IType.DirectBaseTypes"/>.
		/// Note that this method does not return all supertypes - doing so is impossible due to contravariance
		/// (and undesirable for covariance as the list could become very large).
		/// 
		/// The output is ordered so that base types occur before derived types.
		/// </remarks>
		public static IEnumerable<IType> GetAllBaseTypes(this IType type)
		{
			BaseTypeCollector collector = new BaseTypeCollector();
			collector.CollectBaseTypes(type);
			return collector;
		}
Beispiel #11
0
		/// <summary>
		/// Gets all base types.
		/// </summary>
		/// <remarks>This is the reflexive and transitive closure of <see cref="IType.GetBaseTypes"/>.
		/// Note that this method does not return all supertypes - doing so is impossible due to contravariance
		/// (and undesirable for covariance as the list could become very large).
		/// 
		/// The output is ordered so that base types occur in before derived types.
		/// </remarks>
		public static IEnumerable<IType> GetAllBaseTypes(this IType type, ITypeResolveContext context)
		{
			BaseTypeCollector collector = new BaseTypeCollector(context);
			collector.CollectBaseTypes(type);
			return collector;
		}