Table of Contents

Class ResourceFiles

Namespace
Tripous
Assembly
Tripous.dll

Helper for embedded resource files.

public static class ResourceFiles
Inheritance
ResourceFiles
Inherited Members

Methods

FindResourcePath(Assembly, string, string)

Finds the full resource path.

FindResourcePath(Assembly, "Models/Ddl", "Schema.sql")
public static string FindResourcePath(Assembly A, string FolderPath, string FileName)

Parameters

A Assembly
FolderPath string
FileName string

Returns

string

FindResourcePath(Assembly, string, string, string)

Finds the full resource path using a base namespace.

FindResourcePath(Assembly, "Tripous.Data", "Sql", "MyFile.sql")
public static string FindResourcePath(Assembly A, string BaseNamespace, string FolderPath, string FileName)

Parameters

A Assembly
BaseNamespace string
FolderPath string
FileName string

Returns

string

GetResourceFileData(Assembly, string, string)

Returns the raw data of a resource using simple path matching.

public static byte[] GetResourceFileData(Assembly A, string FolderPath, string FileName)

Parameters

A Assembly
FolderPath string
FileName string

Returns

byte[]

GetResourceFileData(Assembly, string, string, string)

Returns the raw data of a resource.

public static byte[] GetResourceFileData(Assembly A, string BaseNamespace, string FolderPath, string FileName)

Parameters

A Assembly
BaseNamespace string
FolderPath string
FileName string

Returns

byte[]

GetResourceFilePaths(Assembly)

Returns all resource names in the assembly.

public static string[] GetResourceFilePaths(Assembly A)

Parameters

A Assembly

Returns

string[]

GetResourceFileStream(Assembly, string, string, string)

Returns a stream for the specified resource.

public static Stream GetResourceFileStream(Assembly A, string BaseNamespace, string FolderPath, string FileName)

Parameters

A Assembly
BaseNamespace string
FolderPath string
FileName string

Returns

Stream

GetResourceFileText(Assembly, string, string)

Returns the text content of a resource using simple path matching.

public static string GetResourceFileText(Assembly A, string FolderPath, string FileName)

Parameters

A Assembly
FolderPath string
FileName string

Returns

string

GetResourceFileText(Assembly, string, string, string)

Returns the text content of a resource.

string Sql = GetResourceFileText(A, "Tripous.Data", "Sql", "Init.sql")
public static string GetResourceFileText(Assembly A, string BaseNamespace, string FolderPath, string FileName)

Parameters

A Assembly
BaseNamespace string
FolderPath string
FileName string

Returns

string

ResourceFileExists(Assembly, string, string)

Returns true if the resource exists.

ResourceFileExists(typeof(MyClass).Assembly, "Sql.Scripts", "MyFile.sql")
public static bool ResourceFileExists(Assembly A, string FolderPath, string FileName)

Parameters

A Assembly
FolderPath string
FileName string

Returns

bool