Пример #1
0
 /// <summary>
 /// Get subchains defining current type definition's inheritance.
 /// </summary>
 /// <returns>Subchains.</returns>
 internal override IEnumerable <InheritanceChain> GetSubChains()
 {
     if (_simulatedType == null)
     {
         return(new InheritanceChain[] { ContainingAssembly.GetChain(typeof(object)) });
     }
     else
     {
         return(GetSubChains(_simulatedType));
     }
 }
Пример #2
0
        /// <summary>
        /// Gets the sub chains.
        /// </summary>
        /// <param name="type">The type which subchains are requested.</param>
        /// <returns>IEnumerable&lt;InheritanceChain&gt;.</returns>
        protected IEnumerable <InheritanceChain> GetSubChains(Type type)
        {
            if (ForcedSubTypes == null)
            {
                yield return(ContainingAssembly.GetChain(type.BaseType));

                foreach (var subType in type.GetInterfaces())
                {
                    yield return(ContainingAssembly.GetChain(subType));
                }
            }
            else
            {
                foreach (var forcedSubType in ForcedSubTypes)
                {
                    yield return(ContainingAssembly.GetChain(forcedSubType));
                }
            }
        }