Beispiel #1
0
 public void ApplyInheritanceForMixins(IEnumerable <MixinContext> ownMixins, ClassContext baseContext, ICollection <MixinContext> mixins)
 {
     foreach (MixinContext inheritedMixin in baseContext.Mixins)
     {
         if (!MixinContextCollection.ContainsOverrideForMixin(ownMixins, inheritedMixin.MixinType))
         {
             mixins.Add(inheritedMixin);
         }
     }
 }
Beispiel #2
0
 // A = overridden, B = override
 public Tuple <MixinContext, MixinContext> GetFirstOverrideThatIsNotOverriddenByBase(IEnumerable <MixinContext> baseMixins,
                                                                                     IEnumerable <MixinContext> potentialOverrides)
 {
     foreach (MixinContext mixin in baseMixins)
     {
         MixinContext overrideForMixin;
         if ((overrideForMixin = MixinContextCollection.GetOverrideForMixin(potentialOverrides, mixin.MixinType)) != null &&
             !MixinContextCollection.ContainsOverrideForMixin(baseMixins, overrideForMixin.MixinType))
         {
             return(Tuple.Create(mixin, overrideForMixin));
         }
     }
     return(null);
 }