Ejemplo n.º 1
0
 public AssemblyDiversion(IDiversionDiviner diviner, IAssemblyInfo old, IAssemblyInfo @new) : base(old, @new)
 {
     _typeDiversions = new Lazy <IDiversions <ITypeInfo, ITypeDiversion> >(() => diviner.DivineDiversions(old.Types, @new.Types,
                                                                                                          (o, n) => new TypeDiversion(diviner, o, n)), true);
     _attributeDiversions = new Lazy <ICollectionDiversions <IAttributeInfo> >(() => diviner.DivineCollectionDiversions(old.Attributes, @new.Attributes), true);
     _hasDiverged         = new Lazy <bool>(() => TypeDiversions.HasDiverged() || AttributeDiversions.HasDiverged() || base.HasDiverged(), true);
 }
Ejemplo n.º 2
0
 public TypeDiversion(IDiversionDiviner diviner, ITypeInfo old, ITypeInfo @new)
     : base(old, @new)
 {
     _memberChanges       = new Lazy <IDiversions <IMemberInfo> >(() => diviner.DivineDiversions(old.Members, @new.Members), true);
     _interfaceChanges    = new Lazy <ICollectionDiversions <ITypeReference> >(() => diviner.DivineCollectionDiversions(old.Interfaces, @new.Interfaces), true);
     _attributeDiversions = new Lazy <ICollectionDiversions <IAttributeInfo> >(() => diviner.DivineCollectionDiversions(old.Attributes, @new.Attributes), true);
     _hasDiverged         = new Lazy <bool>(() => base.HasDiverged() || MemberDiversions.HasDiverged() || InterfaceDiversions.HasDiverged() || AttributeDiversions.HasDiverged(), true);
 }
Ejemplo n.º 3
0
            public DiversionsImpl(IDiversionDiviner diviner, IEnumerable <T> old, IEnumerable <T> @new, Func <T, T, TC> subdiviner)
            {
                var o = old as T[] ?? old.ToArray();
                var n = @new as T[] ?? @new.ToArray();
                var collectionChanges = diviner.DivineCollectionDiversions(o, n);

                Added    = collectionChanges.Added;
                Removed  = collectionChanges.Removed;
                Diverged = o.Except(Removed).Join(n.Except(Added), _ => _, _ => _, subdiviner).Where(c => c.HasDiverged()).ToArray();
            }
Ejemplo n.º 4
0
 public AssemblyDiversionDiviner(IAssemblyInfoFactory assemblyInfoFactory, IDiversionDiviner diviner)
 {
     _assemblyInfoFactory = assemblyInfoFactory;
     _diviner             = diviner;
 }