Class CommonFuncs
Common functions
Inheritance
Inherited Members
Namespace: SprutTechnology.SCPostprocessor
Assembly: SCPostprocessor.dll
Syntax
public static class CommonFuncs
Properties
InputBoxFactory
Externally assigning object that can create InputBox inctances. Do not use it directly, use InputBox() and CreateInputBox() methods instead.
Declaration
public static IInputBoxFactory InputBoxFactory { get; set; }
Property Value
Type | Description |
---|---|
IInputBoxFactory |
Methods
CreateInputBox()
Create empty InputBox window. For this window, you can:
- Set caption of window
- Create groups of parameters
- Create parameters
Declaration
public static IInputBox CreateInputBox()
Returns
Type | Description |
---|---|
IInputBox |
CurDate()
Get current local date
Declaration
public static string CurDate()
Returns
Type | Description |
---|---|
System.String | Current local date in the format: dd.MM.yyyy |
CurISODate()
Get current local date (ISO)
Declaration
public static string CurISODate()
Returns
Type | Description |
---|---|
System.String | Current local date in the format: yyyy-MM-ddTHH:mm:ss.fffZ |
CurTime()
Get current local time
Declaration
public static string CurTime()
Returns
Type | Description |
---|---|
System.String | Get current local time in the format: HH:mm:ss |
InputBox(String, ref Boolean)
Create InputBox window.
Declaration
public static void InputBox(string caption, ref bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.Boolean | value | Passed boolean parameter that takes the entered value from the window. |
InputBox(String, ref Boolean, Boolean[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref bool value, params bool[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.Boolean | value | Passed boolean parameter that takes the entered value from the window. |
System.Boolean[] | possibleValues | Passed possible boolean values for selection. The maximum number of values passed is 2, the rest are ignored. |
InputBox(String, ref Double)
Create InputBox window.
Declaration
public static void InputBox(string caption, ref double value)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.Double | value | Passed double parameter that takes the entered value from the window. |
InputBox(String, ref Double, Double[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref double value, params double[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.Double | value | Passed double parameter that takes the entered value from the window. |
System.Double[] | possibleValues | Passed possible double values for selection. |
InputBox(String, ref Int32)
Create InputBox window.
Declaration
public static void InputBox(string caption, ref int value)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.Int32 | value | Passed integer parameter that takes the entered value from the window. |
InputBox(String, ref Int32, Int32[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref int value, params int[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.Int32 | value | Passed integer parameter that takes the entered value from the window. |
System.Int32[] | possibleValues | Passed possible integer values for selection. |
InputBox(String, ref String)
Create InputBox window
Declaration
public static void InputBox(string caption, ref string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.String | value | Passed string parameter that takes the entered value from the window. |
InputBox(String, ref String, String[])
Create InputBox window with possible values for selection. If passed value is not in the list of possible values then adds it to the list.
Declaration
public static void InputBox(string caption, ref string value, params string[] possibleValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Name of parameter. |
System.String | value | Passed string parameter that takes the entered value from the window. |
System.String[] | possibleValues | Passed possible string values for selection. |
Num(String)
String to numeric converter
Declaration
public static InpNumber Num(string str)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | The string to be converted |
Returns
Type | Description |
---|---|
InpNumber | Numeric value after conversion |
Print(Object[])
Outputting passed values to the console
Declaration
public static void Print(params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | args | Values to output |