NDepend.API Documentation
TryCompareSourceWith(ISourceDecl,ISourceDecl,String) Method
NDepend.CodeModel Namespace > ExtensionMethodsTooling Class > TryCompareSourceWith Method : TryCompareSourceWith(ISourceDecl,ISourceDecl,String) Method
The first line position in a source file.
The second line position in a source file.
If false is returned, contains the plain-english description of the failure.
Opens with a textual files compare/diff tool, two source files declarations, this sourceDecl and sourceDeclOther.
Syntax
[Extension()]
public static bool TryCompareSourceWith( 
   ISourceDecl sourceDecl,
   ISourceDecl sourceDeclOther,
   out string failureReason
)

Parameters

sourceDecl
The first line position in a source file.
sourceDeclOther
The second line position in a source file.
failureReason
If false is returned, contains the plain-english description of the failure.

Return Value

true if the two source declarations were compared successfully.
Remarks
sourceDecl and sourceDeclOther can be obtained through ICodeElement.ICodeElement.SourceDecls.
The textual files compare/diff tool is defined through: NDepend > Options panel > Build Comparison > Sources Files Compare Tool
This method can only be invoked within a .NET Framework 4.x and Windows OS context else it throws a NotSupportedException.
Requirements

Target Platforms: Windows 11, 10, 8, 7and Linux, MacOS with net10.0, net9.0 or net8.0 installed

See Also

Reference

ExtensionMethodsTooling Class
ExtensionMethodsTooling Members
Overload List
ICompareContext Interface
CreateCompareContextWithOlder Method
ExtensionMethodsCQLinqCompare Class
RelyOnCompareContext Property
Compile(String,ICompareContext) Method
CompileMany(IEnumerable<String>,ICompareContext) Method
TryDiffSource Method