Skip to main content

Resource Class

Represents a Win32 resource which can be loaded from and saved to a PE file.

Methods

MethodDescription
Equals(obj)Tests if type, name, and locale of this Resource object match another Resource object.
GetHashCode()Gets a hash code for this Resource object.
Load(file)Loads the resource data from a file. The file is searched for a resource with matching type, name, and locale.
Save(file)Saves the resource to a file. Any existing resource data with matching type, name, and locale is overwritten.

Properties

PropertyDescription
DataGets or sets the raw data of the resource.
LocaleGets or sets the locale of the resource.
NameGets or sets the name of the resource. For a numeric resource identifier, the decimal number is prefixed with a "#".
ResourceTypeGets or sets the type of the resource. This may be one of the ResourceType constants or a user-defined type name.

WixToolset.Dtf.Resources.dll version 5.0.2+aa65968c419420d32e3e1b647aea0082f5ca5b78

Equals(obj) Method

Tests if type, name, and locale of this Resource object match another Resource object.

Declaration

public bool Equals(
System.Object obj
)

Parameters

ParameterTypeDescription
objSystem.ObjectResource object to be compared

Return value

bool True if the objects represent the same resource; false otherwise.

GetHashCode() Method

Gets a hash code for this Resource object.

Declaration

public int GetHashCode()

Return value

int Hash code generated from the resource type, name, and locale.

Load(file) Method

Loads the resource data from a file. The file is searched for a resource with matching type, name, and locale.

Declaration

public void Load(
string file
)

Parameters

ParameterTypeDescription
filestringWin32 PE file containing the resource

Save(file) Method

Saves the resource to a file. Any existing resource data with matching type, name, and locale is overwritten.

Declaration

public void Save(
string file
)

Parameters

ParameterTypeDescription
filestringWin32 PE file to contain the resource

Data Property

Gets or sets the raw data of the resource.

Declaration

public System.Byte[] Data { get; set; } 

Locale Property

Gets or sets the locale of the resource.

Declaration

public int Locale { get; set; } 

Name Property

Gets or sets the name of the resource. For a numeric resource identifier, the decimal number is prefixed with a "#".

Declaration

public string Name { get; set; } 

ResourceType Property

Gets or sets the type of the resource. This may be one of the ResourceType constants or a user-defined type name.

Declaration

public ResourceType ResourceType { get; set; }