Create and remove resource entries from a resource dictionary. More...
Public Member Functions | |
void | CreateNodeAliasEntry (string resourceID, Node node) |
Creates an alias. | |
void | CreateNodeAliasEntry (string resourceID, string relativePath) |
Creates an alias. | |
void | CreateResourceEntry (string resourceID, NodeResource resource) |
Creates a resource entry. | |
void | CreateTextEntry (string resourceID, string text) |
Creates a text resource entry. | |
bool | DeleteEntry (string resourceID) |
Deletes a resource entry from a resource dictionary. | |
Properties | |
IEnumerable< KeyValuePair< string, NodeReferenceBase > > | NodeReferences [get] |
IEnumerable< KeyValuePair< string, NodeResource > > | Resources [get] |
IEnumerable< KeyValuePair< string, string > > | Texts [get] |
Create and remove resource entries from a resource dictionary.
Use the functions in this class to create:
After you create a resource entry and add it to a resource dictionary of a node, you can use in the scope of that resource dictionary the resource ID of that resource entry to access the resource to which the alias or resource entry points.
Creates an alias.
An alias points to a node in your project. After you create an alias and add it to a resource dictionary, use its resource ID to access the node to which this resource entry points. For example, you can use an alias to get a node using a script or the Kanzi Engine API.
resourceID | The resource ID of the alias you want to create. |
node | The node to which this alias points. |
System.ArgumentException | Thrown when you try to create a resource entry with a resource ID already used by another resource entry in the same resource dictionary. |
Examples
Create an alias in a resource dictionary:
Creates an alias.
An alias points to a node in your project. After you create an alias and add it to a resource dictionary, use its resource ID to access the node to which this resource entry points. For example, you can use an alias to get a node using a script or the Kanzi Engine API.
resourceID | The resource ID of the alias you want to create. |
relativePath | The path to the node to which this alias points. |
System.ArgumentException | Thrown when you try to create a resource entry with a resource ID already used by another resource entry in the same resource dictionary. |
Examples
Create an alias in a resource dictionary:
void CreateResourceEntry | ( | string | resourceID, |
NodeResource | resource ) |
Creates a resource entry.
A resource entry points to a resource in your project. After you create a resource entry and add it to a resource dictionary, use its resource ID to access the resource to which this resource entry points.
resourceID | The resource ID of the resource entry you want to create. |
resource | The resource to which this resource entry points. |
System.ArgumentException | Thrown when you try to create a resource entry with a resource ID already used by another resource entry in the same resource dictionary. |
Examples
Create a resource entry in a resource dictionary:
Creates a text resource entry.
A text resource entry contains a string you can use in Text Block nodes. After you create a text resource entry and add it to a resource dictionary, use its resource ID to get the string in the text resource entry.
resourceID | The resource ID of the text resource entry you want to create. |
text | The string this text resource entry contains. |
System.ArgumentException | Thrown when you try to create a text resource entry with a resource ID already used by another resource entry in the same resource dictionary. |
Examples
Create a text resource entry in a resource dictionary:
Deletes a resource entry from a resource dictionary.
Use this function to delete all types of resource entries.
resourceID | The resource ID of the resource entry you want to delete. |
System.ArgumentException | Thrown when you try to remove a resource entry that does not exist in a resource dictionary. |
Examples
Remove a resource entry from a resource dictionary: