internal void CreateUsageQueriesFromAssemblyDiff(AssemblyDiffCollection diff) { var removedTypes = diff.AddedRemovedTypes.RemovedList; if (removedTypes.Count > 0) { // removed types new WhoUsesType(this.myAggregator, removedTypes); } // changed types foreach (var changedType in diff.ChangedTypes) { if (changedType.TypeV1.IsInterface) { this.AddIntefaceChange(changedType); } else if (changedType.TypeV1.IsEnum) { var removedEnumConstants = changedType.Fields.RemovedList; if (removedEnumConstants.Count > 0) { new WhoUsesType(this.myAggregator, changedType.TypeV1); } } else { var removedEvents = changedType.Events.RemovedList; if (removedEvents.Count > 0) { new WhoUsesEvents(this.myAggregator, removedEvents); } var removedMethods = changedType.Methods.RemovedList; if (removedMethods.Count > 0) { new WhoUsesMethod(this.myAggregator, removedMethods); } this.CheckFieldChanges(changedType); if (changedType.Interfaces.RemovedCount > 0) { new WhoUsesType(this.myAggregator, changedType.TypeV1); } if (changedType.HasChangedBaseType) { new WhoUsesType(this.myAggregator, changedType.TypeV1); } } } }
internal void Print(AssemblyDiffCollection diff) { this.PrintAddedRemovedTypes(diff.AddedRemovedTypes); if (diff.ChangedTypes.Count > 0) { foreach (var typeChange in diff.ChangedTypes) { this.PrintTypeChanges(typeChange); } } }
public bool Detect(AssemblyDiffCollection assemblyDiffCollection) { if (assemblyDiffCollection.AddedRemovedTypes.RemovedCount > 0) { return true; } if (assemblyDiffCollection.ChangedTypes.Count > 0) { foreach (var typeChange in assemblyDiffCollection.ChangedTypes) { if (typeChange.HasChangedBaseType) { return true; } if (typeChange.Interfaces.Count > 0) { if (typeChange.Interfaces.Removed.Any()) { return true; } } if (typeChange.Events.Removed.Any()) { return true; } if (typeChange.Fields.Removed.Any()) { return true; } if (typeChange.Methods.Removed.Any()) { return true; } } } return false; }