IPreprocessHelper Interface
Interface provided to help preprocessor extensions.
Methods
| Method | Description |
|---|---|
| AddVariable(context, name, value) | Add a variable. |
| AddVariable(context, name, value, showWarning) | Add a variable. |
| EvaluateFunction(context, function) | Evaluate a function. |
| EvaluateFunction(context, prefix, function, args) | Evaluate a function. |
| GetVariableValue(context, variable, allowMissingPrefix) | Get the value of a variable expression like var.name. |
| GetVariableValue(context, prefix, name) | Get the value of a variable. |
| PreprocessPragma(context, pragmaName, args, parent) | Evaluate a Pragma. |
| PreprocessString(context, value) | Replaces parameters in the source text. |
| RemoveVariable(context, name) | Remove a variable. |
WixToolset.Extensibility.dll version 6.0.0+8c7432e50072e009353ea5f2c956ccf453476f71
AddVariable(context, name, value) Method
Add a variable.
Declaration
public void AddVariable(
WixToolset.Extensibility.Data.IPreprocessContext context,
string name,
string value
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| name | string | The variable name. |
| value | string | The variable value. |
AddVariable(context, name, value, showWarning) Method
Add a variable.
Declaration
public void AddVariable(
WixToolset.Extensibility.Data.IPreprocessContext context,
string name,
string value,
bool showWarning
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| name | string | The variable name. |
| value | string | The variable value. |
| showWarning | bool | Set to true to show variable overwrite warning. |
EvaluateFunction(context, function) Method
Evaluate a function.
Declaration
public string EvaluateFunction(
WixToolset.Extensibility.Data.IPreprocessContext context,
string function
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| function | string | The function expression including the prefix and name. |
Return value
string The function value.
EvaluateFunction(context, prefix, function, args) Method
Evaluate a function.
Declaration
public string EvaluateFunction(
WixToolset.Extensibility.Data.IPreprocessContext context,
string prefix,
string function,
System.String[] args
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| prefix | string | The function prefix. |
| function | string | The function name. |
| args | System.String[] | The arguments for the function. |
Return value
string The function value or null if the function is not defined.
GetVariableValue(context, variable, allowMissingPrefix) Method
Get the value of a variable expression like var.name.
Declaration
public string GetVariableValue(
WixToolset.Extensibility.Data.IPreprocessContext context,
string variable,
bool allowMissingPrefix
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| variable | string | The variable expression including the optional prefix and name. |
| allowMissingPrefix | bool | true to allow the variable prefix to be missing. |
Return value
string The variable value.
GetVariableValue(context, prefix, name) Method
Get the value of a variable.
Declaration
public string GetVariableValue(
WixToolset.Extensibility.Data.IPreprocessContext context,
string prefix,
string name
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| prefix | string | The variable prefix. |
| name | string | The variable name. |
Return value
string The variable value or null if the variable is not set.
PreprocessPragma(context, pragmaName, args, parent) Method
Evaluate a Pragma.
Declaration
public void PreprocessPragma(
WixToolset.Extensibility.Data.IPreprocessContext context,
string pragmaName,
string args,
System.Xml.Linq.XContainer parent
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| pragmaName | string | The pragma's full name ({'<'}prefix{'>'}.{'<'}pragma{'>'}). |
| args | string | The arguments to the pragma. |
| parent | System.Xml.Linq.XContainer | The parent element of the pragma. |
PreprocessString(context, value) Method
Replaces parameters in the source text.
Declaration
public string PreprocessString(
WixToolset.Extensibility.Data.IPreprocessContext context,
string value
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| value | string | Text that may contain parameters to replace. |
Return value
string Text after parameters have been replaced.
RemoveVariable(context, name) Method
Remove a variable.
Declaration
public void RemoveVariable(
WixToolset.Extensibility.Data.IPreprocessContext context,
string name
)
Parameters
| Parameter | Type | Description |
|---|---|---|
| context | WixToolset.Extensibility.Data.IPreprocessContext | The preprocess context. |
| name | string | The variable name. |