Interface IInputBox
The InputBox window. It can be used to ask some additional information from a user. You can create a new instance of this object using CreateInputBox() method. Then use methods of this instance to add properties of type you need:
- AddStringProp
- AddDoubleProp
- AddIntegerProp
- AddBooleanProp
- AddFilePathProp
- etc.
Namespace: DotnetPostprocessing.SDK
Assembly: DotnetPostprocessing.SDK.dll
Syntax
public interface IInputBox
Remarks
string myProgName = "TestProg1";
int myProgNumber = 1000;
var bx = CreateInputBox();
bx.WindowCaption = "Input the program parameters please";
bx.StartGroup("Program parameters");
bx.AddStringProp("Name", myProgName, v => myProgName = v);
bx.AddIntegerProp("Number", myProgNumber, v => myProgNumber = v);
bx.CloseGroup();
bx.Show();
Properties
WindowCaption
The title of the InputBox window.
Declaration
string WindowCaption { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
string myProgName = "TestProg1";
int myProgNumber = 1000;
var bx = CreateInputBox();
bx.WindowCaption = "Input the program parameters please";
bx.StartGroup("Program parameters");
bx.AddStringProp("Name", myProgName, v => myProgName = v);
bx.AddIntegerProp("Number", myProgNumber, v => myProgNumber = v);
bx.CloseGroup();
bx.Show();
Methods
AddBooleanProp(string, bool, InputBoxValueSetter<bool>, InputBoxEnumValuesFormer<bool>)
Adds a new boolean type parameter to the InputBox window. Using the enumValuesFormer parameter you can fill the list of possible values which will be shown for the user as combo box. Additionally you can specify the display name for each possible value. The user will be able to select values only from the specified list.
Declaration
IInputBoxProperty AddBooleanProp(string caption, bool value, InputBoxValueSetter<bool> valueSetter, InputBoxEnumValuesFormer<bool> enumValuesFormer)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
bool | value | The default value for the parameter you add. |
InputBoxValueSetter<bool> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
InputBoxEnumValuesFormer<bool> | enumValuesFormer | Passed possible boolean values for selection. This parameter allows you to set the display names of the values. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
bool use = false;
inputBox.AddBooleanProp("Use upper case", false, newValue => use = newValue,
list => {
list.AddValue(false, "not use");
list.AddValue(true, "USE");
}
);
inputBox.Show();
AddBooleanProp(string, bool, InputBoxValueSetter<bool>, params bool[])
Adds a new boolean type parameter to the InputBox window with the list of possible values. It will be shown as a combo box.
Declaration
IInputBoxProperty AddBooleanProp(string caption, bool value, InputBoxValueSetter<bool> valueSetter, params bool[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
bool | value | The default value for the parameter you add. |
InputBoxValueSetter<bool> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
bool[] | possibleValues | The array of possible values for the parameter. The maximum number of values passed is 2, the rest are ignored. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
bool use = false;
inputBox.AddBooleanProp("Use upper case", false, newValue => use = newValue, false, true);
inputBox.Show();
AddBooleanProp(string, bool, InputBoxValueSetter<bool>)
Adds a new boolean type parameter to the InputBox window. It will be shown as checkbox.
Declaration
IInputBoxProperty AddBooleanProp(string caption, bool value, InputBoxValueSetter<bool> valueSetter)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
bool | value | The default value for the parameter you add. |
InputBoxValueSetter<bool> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
bool use = false;
inputBox.AddBooleanProp("Use upper case", false, newValue => use = newValue);
inputBox.Show();
AddDoubleEditableProp(string, double, InputBoxValueSetter<double>, InputBoxEnumValuesFormer<double>)
Adds a new double type parameter to the InputBox window. Using the enumValuesFormer parameter you can fill the list of possible values which will be shown for the user as combo box. Additionally you can specify the display name for each possible value. If the default value you pass is not in the list of possible values then it will be added to the list with a display name equal to the value itself. The user will be able to either select one of the specified values, or enter their own.
Declaration
IInputBoxProperty AddDoubleEditableProp(string caption, double value, InputBoxValueSetter<double> valueSetter, InputBoxEnumValuesFormer<double> enumValuesFormer)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
double | value | The default value for the parameter you add. |
InputBoxValueSetter<double> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
InputBoxEnumValuesFormer<double> | enumValuesFormer | Passed possible double values for selection. This parameter allows you to set the display names of the values. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
double tolerance = 0.02;
inputBox.AddDoubleEditableProp("Input tolerance", 0.02, newValue => tolerance = newValue,
list => {
list.AddValue(0.2, "Low");
list.AddValue(0.02, "Standard");
list.AddValue(0.002, "High");
}
);
inputBox.Show();
AddDoubleEditableProp(string, double, InputBoxValueSetter<double>, params double[])
Adds a new double type parameter to the InputBox window with the list of possible values. The user will be able to either select one of the specified values, or enter their own.
Declaration
IInputBoxProperty AddDoubleEditableProp(string caption, double value, InputBoxValueSetter<double> valueSetter, params double[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
double | value | The default value for the parameter you add. |
InputBoxValueSetter<double> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
double[] | possibleValues | The array of possible values for the parameter. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
double tolerance = 0.02;
inputBox.AddDoubleEditableProp("Input tolerance", 0.02, newValue => tolerance = newValue, 0.2, 0.02, 0.002);
inputBox.Show();
AddDoubleProp(string, double, InputBoxValueSetter<double>, InputBoxEnumValuesFormer<double>)
Adds a new double type parameter to the InputBox window. Using the enumValuesFormer parameter you can fill the list of possible values which will be shown for the user as combo box. Additionally you can specify the display name for each possible value. The user will be able to select values only from the specified list. If the default value you pass is not in the list of possible values then it will be added to the list with a display name equal to the value itself.
Declaration
IInputBoxProperty AddDoubleProp(string caption, double value, InputBoxValueSetter<double> valueSetter, InputBoxEnumValuesFormer<double> enumValuesFormer)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
double | value | The default value for the parameter you add. |
InputBoxValueSetter<double> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
InputBoxEnumValuesFormer<double> | enumValuesFormer | Passed possible double values for selection. This parameter allows you to set the display names of the values. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
double tolerance = 0.02;
inputBox.AddDoubleProp("Input tolerance", 0.02, newValue => tolerance = newValue,
list => {
list.AddValue(0.2, "Low");
list.AddValue(0.02, "Standard");
list.AddValue(0.002, "High");
}
);
inputBox.Show();
AddDoubleProp(string, double, InputBoxValueSetter<double>, params double[])
Adds a new double type parameter to the InputBox window with the list of possible values. The user will be able to select values only from the specified list.
Declaration
IInputBoxProperty AddDoubleProp(string caption, double value, InputBoxValueSetter<double> valueSetter, params double[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
double | value | The default value for the parameter you add. |
InputBoxValueSetter<double> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
double[] | possibleValues | The array of possible values for the parameter. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
double tolerance = 0.02;
inputBox.AddDoubleProp("Input tolerance", 0.02, newValue => tolerance = newValue, 0.2, 0.02, 0.002);
inputBox.Show();
AddDoubleProp(string, double, InputBoxValueSetter<double>)
Adds a new double parameter to the InputBox window.
Declaration
IInputBoxProperty AddDoubleProp(string caption, double value, InputBoxValueSetter<double> valueSetter)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
double | value | The default value for the parameter you add. |
InputBoxValueSetter<double> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
double tolerance = 0.02;
inputBox.AddDoubleProp("Input tolerance", 0.02, newValue => tolerance = newValue);
inputBox.Show();
AddFilePathProp(string, string, InputBoxValueSetter<string>, string)
Adds a new string type file path parameter to the InputBox window. Allows to use standard File open dialog to choose file path with the specified files filter.
Declaration
IInputBoxProperty AddFilePathProp(string caption, string value, InputBoxValueSetter<string> valueSetter, string filesFilter)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
string | filesFilter | Textual string with the list of possible file extensions to filter files inside
standard File open dialog.
You can use "|" char to divide the display name of the filter from the extentions part and to divide several
filters from each other.
You can use ";" char to divide several file extensions inside one filter string.
|
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string path = "%userprofile%\NewFile.txt";
inputBox.AddFilePathProp("Output file path", path, newValue => path = newValue, "*.txt");
inputBox.Show();
AddFilePathProp(string, string, InputBoxValueSetter<string>)
Adds a new string type file path parameter to the InputBox window. Allows to use standard File open dialog to choose file path.
Declaration
IInputBoxProperty AddFilePathProp(string caption, string value, InputBoxValueSetter<string> valueSetter)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string path = "%userprofile%\NewFile.txt";
inputBox.AddFilePathProp("Output file path", path, newValue => path = newValue);
inputBox.Show();
AddFolderPathProp(string, string, InputBoxValueSetter<string>)
Adds a new string type folder path parameter to the InputBox window. Allows to use standard Folder open dialog to choose folder path.
Declaration
IInputBoxProperty AddFolderPathProp(string caption, string value, InputBoxValueSetter<string> valueSetter)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string path = "%userprofile%\OutFiles";
inputBox.AddFolderPathProp("Output folder", path, newValue => path = newValue);
inputBox.Show();
AddIntegerEditableProp(string, int, InputBoxValueSetter<int>, InputBoxEnumValuesFormer<int>)
Adds a new integer type parameter to the InputBox window. Using the enumValuesFormer parameter you can fill the list of possible values which will be shown for the user as combo box. Additionally you can specify the display name for each possible value. If the default value you pass is not in the list of possible values then it will be added to the list with a display name equal to the value itself. The user will be able to either select one of the specified values, or enter their own.
Declaration
IInputBoxProperty AddIntegerEditableProp(string caption, int value, InputBoxValueSetter<int> valueSetter, InputBoxEnumValuesFormer<int> enumValuesFormer)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
int | value | The default value for the parameter you add. |
InputBoxValueSetter<int> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
InputBoxEnumValuesFormer<int> | enumValuesFormer | Passed possible integer values for selection. This parameter allows you to set the display names of the values. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
int count = 1000;
inputBox.AddIntegerEditableProp("Max lines count", 1000, newValue => count = newValue,
list => {
list.AddValue(1000, "Low");
list.AddValue(10000, "Standard");
list.AddValue(100000, "High");
}
);
inputBox.Show();
AddIntegerEditableProp(string, int, InputBoxValueSetter<int>, params int[])
Adds a new integer type parameter to the InputBox window with the list of possible values. The user will be able to either select one of the specified values, or enter their own.
Declaration
IInputBoxProperty AddIntegerEditableProp(string caption, int value, InputBoxValueSetter<int> valueSetter, params int[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
int | value | The default value for the parameter you add. |
InputBoxValueSetter<int> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
int[] | possibleValues | The array of possible values for the parameter. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
int count = 1000;
inputBox.AddIntegerEditableProp("Max lines count", 1000, newValue => count = newValue, 1000, 10000, 100000);
inputBox.Show();
AddIntegerProp(string, int, InputBoxValueSetter<int>, InputBoxEnumValuesFormer<int>)
Adds a new integer type parameter to the InputBox window. Using the enumValuesFormer parameter you can fill the list of possible values which will be shown for the user as combo box. Additionally you can specify the display name for each possible value. The user will be able to select values only from the specified list. If the default value you pass is not in the list of possible values then it will be added to the list with a display name equal to the value itself.
Declaration
IInputBoxProperty AddIntegerProp(string caption, int value, InputBoxValueSetter<int> valueSetter, InputBoxEnumValuesFormer<int> enumValuesFormer)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
int | value | The default value for the parameter you add. |
InputBoxValueSetter<int> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
InputBoxEnumValuesFormer<int> | enumValuesFormer | Passed possible integer values for selection. This parameter allows you to set the display names of the values. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
int count = 1000;
inputBox.AddIntegerProp("Max lines count", 1000, newValue => count = newValue,
list => {
list.AddValue(1000, "Low");
list.AddValue(10000, "Standard");
list.AddValue(100000, "High");
}
);
inputBox.Show();
AddIntegerProp(string, int, InputBoxValueSetter<int>, params int[])
Adds a new integer type parameter to the InputBox window with the list of possible values. The user will be able to select values only from the specified list.
Declaration
IInputBoxProperty AddIntegerProp(string caption, int value, InputBoxValueSetter<int> valueSetter, params int[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
int | value | The default value for the parameter you add. |
InputBoxValueSetter<int> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
int[] | possibleValues | The array of possible values for the parameter. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
int count = 1000;
inputBox.AddIntegerProp("Max lines count", 1000, newValue => count = newValue, 1000, 10000, 100000);
inputBox.Show();
AddIntegerProp(string, int, InputBoxValueSetter<int>)
Adds a new integer type parameter to the InputBox window.
Declaration
IInputBoxProperty AddIntegerProp(string caption, int value, InputBoxValueSetter<int> valueSetter)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
int | value | The default value for the parameter you add. |
InputBoxValueSetter<int> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
int count = 1000;
inputBox.AddIntegerProp("Max lines count", 1000, newValue => count = newValue);
inputBox.Show();
AddStringEditableProp(string, string, InputBoxValueSetter<string>, InputBoxEnumValuesFormer<string>)
Adds a new string parameter to the InputBox window. Using the enumValuesFormer parameter you can fill the list of possible values which will be shown for the user as combo box. Additionally you can specify the display name for each possible value. If the default value you pass is not in the list of possible values then it will be added to the list with a display name equal to the value itself. The user will be able to either select one of the specified values, or enter their own.
Declaration
IInputBoxProperty AddStringEditableProp(string caption, string value, InputBoxValueSetter<string> valueSetter, InputBoxEnumValuesFormer<string> enumValuesFormer)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
InputBoxEnumValuesFormer<string> | enumValuesFormer | Passed possible string values for selection. This parameter allows you to set the display names of the values. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string clr = "R";
inputBox.AddStringEditableProp("Select color", "R", newValue => clr = newValue,
list => {
list.AddValue("R", "Red color");
list.AddValue("G", "Green color");
list.AddValue("B", "Blue color");
}
);
inputBox.Show();
AddStringEditableProp(string, string, InputBoxValueSetter<string>, params string[])
Adds a new string parameter to the InputBox window with the list of possible values. The user will be able to either select one of the specified values, or enter their own.
Declaration
IInputBoxProperty AddStringEditableProp(string caption, string value, InputBoxValueSetter<string> valueSetter, params string[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
string[] | possibleValues | The array of possible values for the parameter. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string clr = "Red";
inputBox.AddStringEditableProp("Select color", "Red", newValue => clr = newValue, "Red", "Green", "Blue");
inputBox.Show();
AddStringProp(string, string, InputBoxValueSetter<string>, InputBoxEnumValuesFormer<string>)
Adds a new string parameter to the InputBox window. Using the enumValuesFormer parameter you can fill the list of possible values which will be shown for the user as combo box. Additionally you can specify the display name for each possible value. The user will be able to select values only from the specified list. If the default value you pass is not in the list of possible values then it will be added to the list with a display name equal to the value itself.
Declaration
IInputBoxProperty AddStringProp(string caption, string value, InputBoxValueSetter<string> valueSetter, InputBoxEnumValuesFormer<string> enumValuesFormer)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
InputBoxEnumValuesFormer<string> | enumValuesFormer | A delegate (callback procedure) that allows you to fill a list of possible values and their display names for the adding property. It will be shown as a combo box. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string clr = "R";
inputBox.AddStringProp("Select color", "R", newValue => clr = newValue,
list => {
list.AddValue("R", "Red color");
list.AddValue("G", "Green color");
list.AddValue("B", "Blue color");
}
);
inputBox.Show();
AddStringProp(string, string, InputBoxValueSetter<string>, params string[])
Adds a new string parameter to the InputBox window with the list of possible values. The user will be able to select values only from the specified list.
Declaration
IInputBoxProperty AddStringProp(string caption, string value, InputBoxValueSetter<string> valueSetter, params string[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
string[] | possibleValues | The array of possible values for the parameter. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string clr = "Red";
inputBox.AddStringProp("Select color", "Red", newValue => clr = newValue, "Red", "Green", "Blue");
inputBox.Show();
AddStringProp(string, string, InputBoxValueSetter<string>)
Adds a new string parameter to the InputBox window.
Declaration
IInputBoxProperty AddStringProp(string caption, string value, InputBoxValueSetter<string> valueSetter)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Textual name of the parameter. It will be shown for the user. |
string | value | The default value for the parameter you add. |
InputBoxValueSetter<string> | valueSetter | Some delegate (or callback procedure) that the InputBox use to assign the new value back to the property. The easiest way is to use a lambda expression as a callback. For example:
Where
|
Returns
Type | Description |
---|---|
IInputBoxProperty | Link to the property object of the input box. Using this link, you can additionally change some parameters of this property. |
Remarks
var inputBox = CreateInputBox();
string clr = "Red";
inputBox.AddStringProp("Select color", "Red", newValue => clr = newValue);
inputBox.Show();
CloseGroup()
Closes created group of parameters. In connection with StartGroup it can be used to structure parameters. All properties which you will add between StartGroup-CloseGroup calls will be shown inside this group. Without StartGroup and CloseGroup the parameters will be shown at the root level.
Declaration
void CloseGroup()
Remarks
var inputBox = CreateInputBox();
string fontColor = "Red";
string backColor = "Blue";
inputBox.StartGroup("Appearance");
inputBox.AddStringProp("Font color", "Red", newValue => fontColor = newValue, "Red", "Green", "Blue");
inputBox.AddStringProp("Back color", "Blue", newValue => backColor = newValue, "Red", "Green", "Blue");
inputBox.CloseGroup();
inputBox.Show();
Show()
Show created InputBox window.
Declaration
void Show()
Remarks
string myProgName = "TestProg1";
int myProgNumber = 1000;
var bx = CreateInputBox();
bx.WindowCaption = "Input the program parameters please";
bx.StartGroup("Program parameters");
bx.AddStringProp("Name", myProgName, v => myProgName = v);
bx.AddIntegerProp("Number", myProgNumber, v => myProgNumber = v);
bx.CloseGroup();
bx.Show();
StartGroup(string)
Creates a new group of parameters. In connection with CloseGroup it can be used to structure parameters. All properties which you will add between StartGroup-CloseGroup calls will be shown inside this group. Without StartGroup and CloseGroup the parameters will be shown at the root level.
Declaration
IInputBoxProperty StartGroup(string caption)
Parameters
Type | Name | Description |
---|---|---|
string | caption | Name of the group of parameters. |
Returns
Type | Description |
---|---|
IInputBoxProperty | Created group. |
Remarks
var inputBox = CreateInputBox();
string fontColor = "Red";
string backColor = "Blue";
inputBox.StartGroup("Appearance");
inputBox.AddStringProp("Font color", "Red", newValue => fontColor = newValue, "Red", "Green", "Blue");
inputBox.AddStringProp("Back color", "Blue", newValue => backColor = newValue, "Red", "Green", "Blue");
inputBox.CloseGroup();
inputBox.Show();