Description
The SourceFile
property provides the file path of the source file that contains the member described by this TypeDescription
instance. This can be useful for debugging or logging purposes, as it allows developers to trace back to the exact location in the source code where a particular type or member is defined.
Usage
To access the source file path of a type or member, you can use the SourceFile
property of a TypeDescription
instance. This property returns a string
representing the file path.
Example
// Example of accessing the SourceFile property
TypeDescription typeDescription = TypeLibrary.GetTypeDescription(typeof(MyClass));
string sourceFilePath = typeDescription.SourceFile;
// Output the source file path
// Note: Avoid using Console.WriteLine in s&box
Log.Info($"Source file path: {sourceFilePath}");