Interface ICompareContext
Represents a diff context of two ICodeBase objects compared, NewerCodeBase and OlderCodeBase. A ICompareContext object can be obtained through the extension method CreateCompareContextWithOlder(ICodeBase, ICodeBase).
public interface ICompareContext
- Extension Methods
Properties (3)
ContainsChanges
Returns true if any change is detected between OlderCodeBase and NewerCodeBase.
bool ContainsChanges { get; }
Property Value
NewerCodeBase
Gets the newer version of the code base for this ICompareContext object.
ICodeBase NewerCodeBase { get; }
Property Value
Remarks
This property getter has a constant time complexity.
- See Also
OlderCodeBase
Gets the older version of the code base for this ICompareContext object.
ICodeBase OlderCodeBase { get; }
Property Value
Remarks
This property getter has a constant time complexity.
- See Also
Methods (22)
BecameObsolete(IMember)
Returns true if the member is not tagged with System.ObsoleteAttribute in the older version of the code base, but is tagged as obsolete in the newer version of the code base.
bool BecameObsolete(IMember member)
Parameters
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
memberdoes not belong to NewerCodeBase nor OlderCodeBase.
- See Also
CodeWasChanged(ICodeContainer)
Returns true if the code of this codeContainer object, has been modified.
bool CodeWasChanged(ICodeContainer codeContainer)
Parameters
codeContainerICodeContainerThe ICodeContainer object. A ICodeContainer object can be a IAssembly, INamespace, IType or IMethod object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeContaineris not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
CommentsWereChanged(ICodeContainer)
Returns true if comments of this codeContainer object, have been modified.
bool CommentsWereChanged(ICodeContainer codeContainer)
Parameters
codeContainerICodeContainerThe ICodeContainer object. A ICodeContainer object can be a IAssembly, INamespace, IType or IMethod object.
Returns
Remarks
So far, comments change is detected only when ICodeContainer.NbLinesOfComment has been changed.
This method has a constant time complexity.
Exceptions
- ArgumentException
codeContaineris not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
IsInNewerBuild(ICodeElement)
Returns true if the codeElement object is in the newer version of the code base.
bool IsInNewerBuild(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
IsInOlderBuild(ICodeElement)
Returns true if the codeElement object is in the older version of the code base.
bool IsInOlderBuild(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
IsNotUsedAnymore(ICodeElement)
Returns true if the codeElement object is in a third-party assembly (or is a third-party assembly itself), and if it is used by the older version of the code base, but not by the newer version.
bool IsNotUsedAnymore(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object. A ICodeElement object can be a IAssembly, INamespace, IType, IMethod or IField object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
IsPresentInBothBuilds(ICodeElement)
Returns true if the codeElement object is both in the newer and older versions of the code base.
bool IsPresentInBothBuilds(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object.
Returns
Remarks
If true is returned, this means that the codeElement has not been added nor removed.
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
IsUsedDifferently(ICodeElementParent)
Returns true if the codeElementParent is a namespace or a type in a third-party assembly (or is a third-party assembly itself) and if some of its children code elements are not used anymore by the newer version of the code base, or are used by the newer version of the code base, but are not used by the older version.
bool IsUsedDifferently(ICodeElementParent codeElementParent)
Parameters
codeElementParentICodeElementParentThe ICodeElementParent object. A ICodeElementParent object can be a IAssembly, INamespace or IType object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementParentis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
IsUsedRecently(ICodeElement)
Returns true if the codeElement object is in a third-party assembly (or is a third-party assembly itself), and if it is used by the newer version of the code base, but not by the older version.
bool IsUsedRecently(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object. A ICodeElement object can be a IAssembly, INamespace, IType, IMethod or IField object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
MeInOtherBuild<T>(T)
Returns the older version of codeElement if IsInNewerBuild(ICodeElement), else return the older version.
T MeInOtherBuild<T>(T codeElement) where T : class, ICodeElement
Parameters
codeElementTThe ICodeElement object.
Returns
- T
Type Parameters
TT is a ICodeElement type.
Remarks
If codeElement has been added in newer build, or removed from older build, this method returns null.
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
NewerVersion<T>(T)
Returns the newer version of the codeElement object.
T NewerVersion<T>(T codeElement) where T : class, ICodeElement
Parameters
codeElementTThe ICodeElement object.
Returns
- T
Type Parameters
TT is a ICodeElement type.
Remarks
If codeElement is already the newer version, returns the codeElement object.
If codeElement has been removed and has no corresponding newer version, returns null.
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
-
NewerVersion<T>(T)
OlderVersion<T>(T)
Returns the older version of the codeElement object.
T OlderVersion<T>(T codeElement) where T : class, ICodeElement
Parameters
codeElementTThe ICodeElement object.
Returns
- T
Type Parameters
TT is a ICodeElement type.
Remarks
If codeElement is already the older version, returns the codeElement object.
If codeElement has been added and has no corresponding older version, returns null.
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
-
OlderVersion<T>(T)
VisibilityWasChanged(IMember)
Returns true if the visibility of this member has been changed.
bool VisibilityWasChanged(IMember member)
Parameters
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
memberdoes not belong to NewerCodeBase nor OlderCodeBase.
- See Also
WasAdded(ICodeElement)
Returns true if the codeElement object has been added and thus, is not present in the older version of the code base.
bool WasAdded(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object. A ICodeElement object can be a IAssembly, INamespace, IType, IMethod or IField object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
WasAdded(IAbsoluteDirectoryPath)
Returns true if the sourceDirPath has been added since the baseline.
bool WasAdded(IAbsoluteDirectoryPath sourceDirPath)
Parameters
sourceDirPathIAbsoluteDirectoryPathThe absolute directory path that contains some source files.
Returns
Remarks
sourceDirPath can be obtained from ICodeElement.SourceDecls , ISourceDecl.SourceFile.FilePath.ParentDirectoryPath.
This method works even when the path is rebased, thanks to an heuristic.
- See Also
WasAdded(IAbsoluteFilePath)
Returns true if the sourceFilePath has been added since the baseline.
bool WasAdded(IAbsoluteFilePath sourceFilePath)
Parameters
sourceFilePathIAbsoluteFilePathThe absolute source file path.
Returns
Remarks
sourceFilePath can be obtained from ICodeElement.SourceDecls , ISourceDecl.SourceFile.FilePath.
This method works even when the path is rebased, thanks to an heuristic.
- See Also
WasChanged(ICodeElement)
Returns true if the codeElement object was changed in any way (code change, comment change, visibility change...).
bool WasChanged(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
WasChanged(IAbsoluteDirectoryPath)
Returns true if the sourceDirPath contains source files changed, added or removed since the baseline.
bool WasChanged(IAbsoluteDirectoryPath sourceDirPath)
Parameters
sourceDirPathIAbsoluteDirectoryPathThe absolute directory path that contains some source files.
Returns
Remarks
sourceDirPath can be obtained from ICodeElement.SourceDecls , ISourceDecl.SourceFile.FilePath.ParentDirectoryPath.
This method works even when the path is rebased, thanks to an heuristic.
- See Also
WasChanged(IAbsoluteFilePath)
Returns true if the sourceFilePath content is different between the older and the newer build.
bool WasChanged(IAbsoluteFilePath sourceFilePath)
Parameters
sourceFilePathIAbsoluteFilePathThe absolute source file path.
Returns
Remarks
sourceFilePath can be obtained from ICodeElement.SourceDecls , ISourceDecl.SourceFile.FilePath.
If only some formatting have been changed within the source file without touching any code behavior, the source file is seen as changed while no code element declared within the source file is seen as changed.
This method works even when the path is rebased, thanks to an heuristic.
- See Also
WasRemoved(ICodeElement)
Returns true if the codeElement object has been removed and thus, is not present in the newer version of the code base.
bool WasRemoved(ICodeElement codeElement)
Parameters
codeElementICodeElementThe ICodeElement object. A ICodeElement object can be a IAssembly, INamespace, IType, IMethod or IField object.
Returns
Remarks
This method has a constant time complexity.
Exceptions
- ArgumentException
codeElementis not NewerCodeBase nor OlderCodeBase not a code element that belong to any of these code base.
- See Also
WasRemoved(IAbsoluteDirectoryPath)
Returns true if the sourceDirPath has been removed since the baseline.
bool WasRemoved(IAbsoluteDirectoryPath sourceDirPath)
Parameters
sourceDirPathIAbsoluteDirectoryPathThe absolute directory path that contains some source files.
Returns
Remarks
sourceDirPath can be obtained from ICodeElement.SourceDecls , ISourceDecl.SourceFile.FilePath.ParentDirectoryPath.
The code element from which the sourceDirPath is obtained must be obtained from OlderCodeBase.
This method works even when the path is rebased, thanks to an heuristic.
- See Also
WasRemoved(IAbsoluteFilePath)
Returns true if the sourceFilePath has been removed since the baseline.
bool WasRemoved(IAbsoluteFilePath sourceFilePath)
Parameters
sourceFilePathIAbsoluteFilePathThe absolute source file path.
Returns
Remarks
sourceFilePath can be obtained from ICodeElement.SourceDecls , ISourceDecl.SourceFile.FilePath.
The code element from which the sourceFilePath is obtained must be obtained from OlderCodeBase.
This method works even when the path is rebased, thanks to an heuristic.
- See Also