protected override IDiffItem GenerateDiffItem(TypeDefinition oldElement, TypeDefinition newElement) { IEnumerable <IDiffItem> attributeDiffs = new CustomAttributeComparer().GetMultipleDifferences(oldElement.CustomAttributes, newElement.CustomAttributes); IEnumerable <IDiffItem> declarationDiffs = EnumerableExtensions.ConcatAll <IDiffItem>( attributeDiffs, CheckVisibility(oldElement, newElement) ); IEnumerable <IDiffItem> childrenDiffs = EnumerableExtensions.ConcatAll <IDiffItem>( GetFieldDifferences(oldElement, newElement), GetPropertyDifferences(oldElement, newElement), GetMethodDifferences(oldElement, newElement), GetEventDifferences(oldElement, newElement), GetNestedTypeDiffs(oldElement, newElement) ); if (declarationDiffs.IsEmpty() && childrenDiffs.IsEmpty()) { return(null); } return(new TypeDiffItem(oldElement, newElement, declarationDiffs, childrenDiffs.Cast <IMetadataDiffItem>())); }
public IMetadataDiffItem <AssemblyDefinition> Compare() { IEnumerable <IDiffItem> declarationDiffs = new CustomAttributeComparer().GetMultipleDifferences(oldAssembly.CustomAttributes, newAssembly.CustomAttributes); IEnumerable <IDiffItem> childrenDiffs = new ModuleComparer().GetMultipleDifferences(oldAssembly.Modules, newAssembly.Modules); if (declarationDiffs.IsEmpty() && childrenDiffs.IsEmpty()) { return(null); } return(new AssemblyDiffItem(oldAssembly, newAssembly, declarationDiffs, childrenDiffs.Cast <IMetadataDiffItem <ModuleDefinition> >())); }
protected override IDiffItem GenerateDiffItem(EventDefinition oldElement, EventDefinition newElement) { IEnumerable <IDiffItem> declarationDiffs = new CustomAttributeComparer().GetMultipleDifferences(oldElement.CustomAttributes, newElement.CustomAttributes); IEnumerable <IMetadataDiffItem <MethodDefinition> > childrenDiffs = GenerateAccessorDifferences(oldElement, newElement); if (declarationDiffs.IsEmpty() && childrenDiffs.IsEmpty()) { return(null); } return(new EventDiffItem(oldElement, newElement, declarationDiffs, childrenDiffs)); }
protected override IDiffItem GenerateDiffItem(FieldDefinition oldElement, FieldDefinition newElement) { IEnumerable <IDiffItem> attributeDiffs = new CustomAttributeComparer().GetMultipleDifferences(oldElement.CustomAttributes, newElement.CustomAttributes); IEnumerable <IDiffItem> fieldTypeDiffs = GetFieldTypeDiff(oldElement, newElement); IEnumerable <IDiffItem> declarationDiffs = EnumerableExtensions.ConcatAll( attributeDiffs, CheckVisibility(oldElement, newElement), CheckStaticFlag(oldElement, newElement), fieldTypeDiffs ); if (declarationDiffs.IsEmpty()) { return(null); } return(new FieldDiffItem(oldElement, newElement, declarationDiffs)); }
private IEnumerable <IDiffItem> GetDeclarationDiffsChecked(MethodDefinition oldMethod, MethodDefinition newMethod) { IEnumerable <IDiffItem> attributeDifferences = new CustomAttributeComparer().GetMultipleDifferences(oldMethod.CustomAttributes, newMethod.CustomAttributes); IEnumerable <IDiffItem> reducedVisibilityDiff = CheckVisibility(oldMethod, newMethod); IEnumerable <IDiffItem> virtualFlagDiff = CheckVirtualFlag(oldMethod, newMethod); IEnumerable <IDiffItem> staticFlagDiff = CheckStaticFlag(oldMethod, newMethod); IEnumerable <IDiffItem> returnTypeDiff = GetReturnTypeDifference(oldMethod, newMethod); IEnumerable <IDiffItem> parameterNameDifferences = GetParameterNameDiffs(oldMethod, newMethod); IEnumerable <IDiffItem> declarationDiffs = EnumerableExtensions.ConcatAll( attributeDifferences, reducedVisibilityDiff, virtualFlagDiff, staticFlagDiff, returnTypeDiff, parameterNameDifferences ); return(declarationDiffs); }