Skip to main content

CustomActionData Class

Contains a collection of key-value pairs suitable for passing between immediate and deferred/rollback/commit custom actions.

Methods

MethodDescription
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

PropertyDescription
CountGets the number of items in the data.
IsReadOnlyGets a value indicating whether the data is read-only.
ItemGets or sets a data value with a specified key.
KeysGets a collection object containing all the keys of the data.
ValuesGets a collection containing all the values of the data.

Fields

FieldDescription
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 version 5.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

ParameterTypeDescription
keystringCase-sensitive data key.
valuestringData value (may be null).

Exceptions

ExceptionDescription
T:System.ArgumentExceptionthe 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

ParameterTypeDescription
keystringCase-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.KeyValuePair2<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

ParameterTypeDescription
keystringCase-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

ParameterTypeDescription
keystringCase-sensitive data key.

Exceptions

ExceptionDescription
T:System.ArgumentExceptionthe 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; }