Table of Contents

Class ProjectFile

Namespace
Tlumach.Validation
Assembly
Tlumach.dll

A file that a project includes, as the IDE or MSBuild reports it.

public sealed class ProjectFile
Inheritance
ProjectFile
Inherited Members

Constructors

ProjectFile(string, string?, string?, IReadOnlyDictionary<string, string>?)

Initializes a new instance of the ProjectFile class.

public ProjectFile(string fullPath, string? itemType, string? link = null, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

fullPath string

The full path of the file.

itemType string

The MSBuild item type, such as AdditionalFiles, EmbeddedResource, or None.

link string

The path at which the project shows the file, relative to the project directory, when it differs from the location of the file (the Link metadata of a linked file); otherwise null.

metadata IReadOnlyDictionary<string, string>

The MSBuild metadata of the item, such as Type or LogicalName, or null when they are not known. The validation uses them to check how ResX translations are embedded; when they are not known, that check is skipped.

Fields

AdditionalFilesItemType

The item type of the items that the Tlumach generator processes.

public const string AdditionalFilesItemType = "AdditionalFiles"

Field Value

string

EmbeddedResourceItemType

The item type of the files that a project embeds into its assembly.

public const string EmbeddedResourceItemType = "EmbeddedResource"

Field Value

string

Properties

FullPath

Gets the full path of the file.

public string FullPath { get; }

Property Value

string

IsEmbeddedResource

Gets a value indicating whether the project embeds the file into its assembly (the item type is EmbeddedResource).

public bool IsEmbeddedResource { get; }

Property Value

bool

IsGeneratorInput

Gets a value indicating whether the generator processes the file (the item type is AdditionalFiles).

public bool IsGeneratorInput { get; }

Property Value

bool

ItemType

Gets the MSBuild item type.

public string ItemType { get; }

Property Value

string

Gets the path at which the project shows a linked file, relative to the project directory, or null for a file that the project shows where it is. The name of an embedded resource follows this path.

public string? Link { get; }

Property Value

string

Metadata

Gets the MSBuild metadata of the item (compared without regard to case), or null when they are not known.

public IReadOnlyDictionary<string, string>? Metadata { get; }

Property Value

IReadOnlyDictionary<string, string>