ResourceCollection Class
Allows reading and editing of resource data in a Win32 PE file.
Methods
Section titled “Methods”| Method | Description |
|---|---|
| Add(item) | Adds a new item to the collection. |
| Clear() | Removes all resources from the collection. |
| Contains(item) | Tests if the collection contains an item. |
| CopyTo(array, arrayIndex) | Copies the collection into an array. |
| Find(resFile) | Locates all resources in a file, including all resource types and languages. For each located resource, a «see T:WixToolset.Dtf.Resources.Resource» instance (or subclass) is added to the collection. |
| Find(resFile, type) | Locates all resources in a file of a given type, including all languages. For each located resource, a «see T:WixToolset.Dtf.Resources.Resource» instance (or subclass) is added to the collection. |
| Find(resFile, type, name) | Locates all resources in a file of a given type and language. For each located resource, a «see T:WixToolset.Dtf.Resources.Resource» instance (or subclass) is added to the collection. |
| GetEnumerator() | Gets an enumerator over all resources in the collection. |
| IndexOf(item) | Gets the index of an item in the collection. |
| Insert(index, item) | Inserts a item into the collection. |
| Load(file) | For all resources in the collection, loads their data from a resource file. |
| Remove(item) | Removes an item to the collection. |
| Save(file) | For all resources in the collection, saves their data to a resource file. |
Properties
Section titled “Properties”| Property | Description |
|---|---|
| Count | Gets the number of resources in the collection. |
| Item | Gets or sets the element at the specified index. |
Remarks
Section titled “Remarks”To use this class:
- Create a new ResourceCollection
- Locate resources for the collection by calling one of the «see M:WixToolset.Dtf.Resources.ResourceCollection.Find(System.String)» methods
- Load data of one or more «see T:WixToolset.Dtf.Resources.Resource» s from a file by calling the «see M:WixToolset.Dtf.Resources.ResourceCollection.Load(System.String)» method of the Resource class, or load them all at once (more efficient) with the «see M:WixToolset.Dtf.Resources.ResourceCollection.Load(System.String)» method of the ResourceCollection.
- Read and/or edit data of the individual Resource objects using the methods on that class.
- Save data of one or more «see T:WixToolset.Dtf.Resources.Resource» s to a file by calling the «see M:WixToolset.Dtf.Resources.ResourceCollection.Save(System.String)» method of the Resource class, or save them all at once (more efficient) with the «see M:WixToolset.Dtf.Resources.ResourceCollection.Save(System.String)» method of the ResourceCollection.
WixToolset.Dtf.Resources.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8
Add(item) Method
Section titled “Add(item) Method”Adds a new item to the collection.
Declaration
Section titled “Declaration”public void Add( Resource item)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| item | Resource | The Resource to add. |
Clear() Method
Section titled “Clear() Method”Removes all resources from the collection.
Declaration
Section titled “Declaration”public void Clear()Contains(item) Method
Section titled “Contains(item) Method”Tests if the collection contains an item.
Declaration
Section titled “Declaration”public bool Contains( Resource item)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| item | Resource | The Resource to search for. |
Return value
Section titled “Return value”bool true if the item is found; false otherwise
CopyTo(array, arrayIndex) Method
Section titled “CopyTo(array, arrayIndex) Method”Copies the collection into an array.
Declaration
Section titled “Declaration”public void CopyTo( Resource[] array, int arrayIndex)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| array | Resource[] | The array to copy into. |
| arrayIndex | int | The starting index in the destination array. |
Find(resFile) Method
Section titled “Find(resFile) Method”Locates all resources in a file, including all resource types and languages. For each located resource, a «see T:WixToolset.Dtf.Resources.Resource» instance (or subclass) is added to the collection.
Declaration
Section titled “Declaration”public void Find( string resFile)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| resFile | string | The file to be searched for resources. |
Exceptions
Section titled “Exceptions”| Exception | Description |
|---|---|
| T:System.IO.IOException | resources could not be read from the file |
Find(resFile, type) Method
Section titled “Find(resFile, type) Method”Locates all resources in a file of a given type, including all languages. For each located resource, a «see T:WixToolset.Dtf.Resources.Resource» instance (or subclass) is added to the collection.
Declaration
Section titled “Declaration”public void Find( string resFile, ResourceType type)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| resFile | string | The file to be searched for resources. |
| type | ResourceType | The type of resource to search for; may be one of the ResourceType constants or a user-defined type. |
Exceptions
Section titled “Exceptions”| Exception | Description |
|---|---|
| T:System.IO.IOException | resources could not be read from the file |
Find(resFile, type, name) Method
Section titled “Find(resFile, type, name) Method”Locates all resources in a file of a given type and language. For each located resource, a «see T:WixToolset.Dtf.Resources.Resource» instance (or subclass) is added to the collection.
Declaration
Section titled “Declaration”public void Find( string resFile, ResourceType type, string name)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| resFile | string | The file to be searched for resources. |
| type | ResourceType | The type of resource to search for; may be one of the ResourceType constants or a user-defined type. |
| name | string | The name of the resource to search for. |
Exceptions
Section titled “Exceptions”| Exception | Description |
|---|---|
| T:System.IO.IOException | resources could not be read from the file |
GetEnumerator() Method
Section titled “GetEnumerator() Method”Gets an enumerator over all resources in the collection.
Declaration
Section titled “Declaration”public IEnumerator<WixToolset.Dtf.Resources.Resource> GetEnumerator()IndexOf(item) Method
Section titled “IndexOf(item) Method”Gets the index of an item in the collection.
Declaration
Section titled “Declaration”public int IndexOf( Resource item)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| item | Resource | The Resource to search for. |
Return value
Section titled “Return value”int The index of the item, or -1 if not found.
Insert(index, item) Method
Section titled “Insert(index, item) Method”Inserts a item into the collection.
Declaration
Section titled “Declaration”public void Insert( int index, Resource item)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| index | int | The insertion index. |
| item | Resource | The Resource to insert. |
Load(file) Method
Section titled “Load(file) Method”For all resources in the collection, loads their data from a resource file.
Declaration
Section titled “Declaration”public void Load( string file)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| file | string | The file from which resources are loaded. |
Remove(item) Method
Section titled “Remove(item) Method”Removes an item to the collection.
Declaration
Section titled “Declaration”public bool Remove( Resource item)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| item | Resource | The Resource to remove. |
Save(file) Method
Section titled “Save(file) Method”For all resources in the collection, saves their data to a resource file.
Declaration
Section titled “Declaration”public void Save( string file)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| file | string | The file to which resources are saved. |
Count Property
Section titled “Count Property”Gets the number of resources in the collection.
Declaration
Section titled “Declaration”public int Count { get; set; }Item Property
Section titled “Item Property”Gets or sets the element at the specified index.
Declaration
Section titled “Declaration”public Resource Item { get; set; }