CustomActionData Class
Contains a collection of key-value pairs suitable for passing between immediate and deferred/rollback/commit custom actions.
Methods
Method | Description |
---|---|
Add(key, value) | Adds a key and value to the data collection. |
Clear() | Removes all items from the data. |
ContainsKey(key) | Determines whether the data contains an item with the specified key. |
GetEnumerator() | Returns an enumerator that iterates through the collection. |
Remove(key) | Removes the item with the specified key from the data. |
ToString() | Gets a string representation of the data suitable for persisting in a property. |
Properties
Property | Description |
---|---|
Count | Gets the number of items in the data. |
IsReadOnly | Gets a value indicating whether the data is read-only. |
Item | Gets or sets a data value with a specified key. |
Keys | Gets a collection object containing all the keys of the data. |
Values | Gets a collection containing all the values of the data. |
Fields
Field | Description |
---|---|
PropertyName | ”CustomActionData” literal property name. |
Remarks
Call the «see M:WixToolset.Dtf.WindowsInstaller.CustomActionData.ToString» method to get a string suitable for storing in a property and reconstructing the custom action data later.
See also
- P:WixToolset.Dtf.WindowsInstaller.Session.CustomActionData
- M:WixToolset.Dtf.WindowsInstaller.Session.DoAction(System.String,WixToolset.Dtf.WindowsInstaller.CustomActionData)
WixToolset.Dtf.WindowsInstaller.dll
version5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8
Add(key, value) Method
Adds a key and value to the data collection.
Declaration
public void Add( string key, string value)
Parameters
Parameter | Type | Description |
---|---|---|
key | string | Case-sensitive data key. |
value | string | Data value (may be null). |
Exceptions
Exception | Description |
---|---|
T:System.ArgumentException | the key does not consist solely of letters, |
numbers, and the period, underscore, and space characters. |
Clear() Method
Removes all items from the data.
Declaration
public void Clear()
ContainsKey(key) Method
Determines whether the data contains an item with the specified key.
Declaration
public bool ContainsKey( string key)
Parameters
Parameter | Type | Description |
---|---|---|
key | string | Case-sensitive data key. |
Return value
bool
true if the data contains an item with the key; otherwise, false
GetEnumerator() Method
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<System.Collections.Generic.KeyValuePair`2<System.String,System.String>> GetEnumerator()
Return value
IEnumerator<System.Collections.Generic.KeyValuePair
2<System.String,System.String>>` An enumerator that can be used to iterate through the collection.
Remove(key) Method
Removes the item with the specified key from the data.
Declaration
public bool Remove( string key)
Parameters
Parameter | Type | Description |
---|---|---|
key | string | Case-sensitive data key. |
Return value
bool
true if the item was successfully removed from the data; false if an item with the specified key was not found
ToString() Method
Gets a string representation of the data suitable for persisting in a property.
Declaration
public string ToString()
Return value
string
Data string in the form “Key1=Value1;Key2=Value2”
Count Property
Gets the number of items in the data.
Declaration
public int Count { get; set; }
IsReadOnly Property
Gets a value indicating whether the data is read-only.
Declaration
public bool IsReadOnly { get; set; }
Item Property
Gets or sets a data value with a specified key.
Declaration
public string Item[ string key] { get; set; }
Parameters
Parameter | Type | Description |
---|---|---|
key | string | Case-sensitive data key. |
Exceptions
Exception | Description |
---|---|
T:System.ArgumentException | the key does not consist solely of letters, |
numbers, and the period, underscore, and space characters. |
Keys Property
Gets a collection object containing all the keys of the data.
Declaration
public System.Collections.Generic.ICollection<System.String> Keys { get; set; }
Values Property
Gets a collection containing all the values of the data.
Declaration
public System.Collections.Generic.ICollection<System.String> Values { get; set; }