In This Article

SourceFile Class

Represents a source code file that can be loaded by an IProjectAssembly.

public class SourceFile : ISourceFile, IKeyedObject
Inheritance:
object object
Implements:
ISourceFile IKeyedObject

Constructors

SourceFile(string, params ITypeDefinition[])

Initializes an instance of the class.

public SourceFile(string key, params ITypeDefinition[] typeDefs)
Parameter Type Description
key string

The unique key that identifies the source file, which is generally a full file path or GUID.

typeDefs ITypeDefinition[]

The collection of ITypeDefinition objects contained in the source file.

SourceFile(string, IEnumerable<ITypeDefinition>)

Initializes an instance of the class.

public SourceFile(string key, IEnumerable<ITypeDefinition> typeDefs)
Parameter Type Description
key string

The unique key that identifies the source file, which is generally a full file path or GUID.

typeDefs IEnumerable<ITypeDefinition>

The collection of ITypeDefinition objects contained in the source file.

SourceFile(string, IEnumerable<ITypeDefinition>, IEnumerable<IUsingDirective>?)

Initializes an instance of the class.

public SourceFile(string key, IEnumerable<ITypeDefinition> typeDefs, IEnumerable<IUsingDirective>? globalUsingDirectives)
Parameter Type Description
key string

The unique key that identifies the source file, which is generally a full file path or GUID.

typeDefs IEnumerable<ITypeDefinition>

The collection of ITypeDefinition objects contained in the source file.

globalUsingDirectives IEnumerable<IUsingDirective>

The collection of global using directives.

Properties

GlobalUsingDirectives

The collection of global IUsingDirective objects contained in the source file.

public IUsingDirectiveCollection GlobalUsingDirectives { get; }

Property Value

IUsingDirectiveCollection

Key

The unique key that identifies the source file, which is generally a full file path or GUID.

public string Key { get; }

Property Value

string

TypeDefinitions

The collection of ITypeDefinition objects contained in the source file.

public ITypeDefinitionCollection TypeDefinitions { get; }

Property Value

ITypeDefinitionCollection

Methods

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Inherited Members

Extension Methods