NDepend.API Documentation
TryOpenSource(ICodeElement,String) Method
NDepend.CodeModel Namespace > ExtensionMethodsTooling Class > TryOpenSource Method : TryOpenSource(ICodeElement,String) Method
The code element.
If false is returned, contains the plain-english description of the failure.
Opens the source file containing the declaration of this ICodeElement, and points to the declaration line.
Syntax
[Extension()]
public static bool TryOpenSource( 
   ICodeElement codeElement,
   out string failureReason
)

Parameters

codeElement
The code element.
failureReason
If false is returned, contains the plain-english description of the failure.

Return Value

true if the source declaration was opened successfully.
Remarks
Code elements such as IType, INamespace or IAssembly objects, often have multiple source declarations in the sequence ICodeElement.SourceDecls.
In such a case, a dialog is shown to the user asking which declaration should be opened.
The source file declaration is opened in the editor tool defined through: NDepend > Options panel > Source File Editor 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, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsTooling Class
ExtensionMethodsTooling Members
Overload List