Class JobVariableHelper
- Namespace
- ArcanaDevelopment.adTempus.Shared
- Assembly
- ArcanaDevelopment.adTempus.Shared.dll
public static class JobVariableHelper
- Inheritance
-
objectJobVariableHelper
Methods
CompareCollections(IEnumerable, IEnumerable, IList, IList)
Compares this JobVariableCollection to another and returns collections containing changes (additions and modifications) and deletions.
public static void CompareCollections(IEnumerable source, IEnumerable target, IList changes, IList deletions)
Parameters
| Name | Type | Description |
|---|---|---|
source |
IEnumerable | |
target |
IEnumerable | |
changes |
IList | A collection of variables that exist in the target collection but not in the current collection, or that exist in both collections but have different values. |
deletions |
IList | A collection of variables that exist in the current collection but not in the target collection. |
GetBooleanValue(IJobVariable)
Gets or sets the value as a boolean value.
public static bool? GetBooleanValue(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- bool?
Remarks
If the value is set using this property, the VariableType is changed to JobVariableType.Boolean. This property returns null if the variable has no value, or if the value cannot be converted to a boolean. adTempus stores boolean values as "1" (true) or "0" (false).
GetDateTimeValue(IJobVariable)
Gets or sets the value as a DateTime.
public static DateTime? GetDateTimeValue(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- DateTime?
Remarks
If the value is set using this property, the VariableType is changed to JobVariableType.DateTime. This property returns null if the variable has no value, or if the value cannot be converted to a DateTime. adTempus stores DateTime values in the format "yyyy-MM-dd HH:mm:ss.fff"
GetDateValue(IJobVariable)
Gets or sets the value as a DateTime containing only a date.
public static DateTime? GetDateValue(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- DateTime?
Remarks
If the value is set using this property, the VariableType is changed to JobVariableType.Date. This property returns null if the variable has no value, or if the value cannot be converted to a DateTime. adTempus stores DateTime values in the format "yyyy-MM-dd"
GetDecimalValue(IJobVariable)
Gets or sets the value as a decimal.
public static decimal? GetDecimalValue(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- decimal?
Remarks
If the value is set using this property, the VariableType is changed to JobVariableType.Decimal. This property returns null if the variable has no value, or if the value cannot be converted to a decimal.
GetIntegerValue(IJobVariable)
Gets or sets the value as an integer.
public static int? GetIntegerValue(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- int?
Remarks
If the value is set using this property, the VariableType is changed to JobVariableType.Integer. This property returns null if the variable has no value, or if the value cannot be converted to an integer.
GetStringValue(IJobVariable)
Gets or sets the value as a string.
public static string GetStringValue(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- string
Remarks
If the value is set using this property, the VariableType is changed to JobVariableType.String.
GetTimeValue(IJobVariable)
Gets or sets the value as a DateTime value that stores only the time.
public static DateTime? GetTimeValue(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- DateTime?
Remarks
If the value is set using this property, the VariableType is changed to JobVariableType.Time. This property returns null if the variable has no value, or if the value cannot be converted to a DateTime. adTempus stores DateTime values in the format "HH:mm:ss.fff"
SetBooleanValue(IJobVariable, bool?)
public static void SetBooleanValue(IJobVariable variable, bool? value)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
value |
bool? |
SetDateTimeValue(IJobVariable, DateTime?)
public static void SetDateTimeValue(IJobVariable variable, DateTime? value)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
value |
DateTime? |
SetDateValue(IJobVariable, DateTime?)
public static void SetDateValue(IJobVariable variable, DateTime? value)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
value |
DateTime? |
SetDecimalValue(IJobVariable, decimal?)
public static void SetDecimalValue(IJobVariable variable, decimal? value)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
value |
decimal? |
SetIntegerValue(IJobVariable, int?)
public static void SetIntegerValue(IJobVariable variable, int? value)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
value |
int? |
SetStringValue(IJobVariable, string)
public static void SetStringValue(IJobVariable variable, string value)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
value |
string |
SetTimeValue(IJobVariable, DateTime?)
public static void SetTimeValue(IJobVariable variable, DateTime? value)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
value |
DateTime? |
TryParseDate(string, out DateTime)
public static bool TryParseDate(string newValue, out DateTime returnValue)
Parameters
| Name | Type | Description |
|---|---|---|
newValue |
string | |
returnValue |
DateTime |
Returns
- bool
TryParseDateTime(string, out DateTime)
public static bool TryParseDateTime(string newValue, out DateTime returnValue)
Parameters
| Name | Type | Description |
|---|---|---|
newValue |
string | |
returnValue |
DateTime |
Returns
- bool
TryParseTime(string, out DateTime)
public static bool TryParseTime(string newValue, out DateTime returnValue)
Parameters
| Name | Type | Description |
|---|---|---|
newValue |
string | |
returnValue |
DateTime |
Returns
- bool
TrySet(IJobVariable, JobVariableType, string)
Tries to set the variable to the specified type and value.
public static bool TrySet(IJobVariable variable, JobVariableType varType, string newValue)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable | |
varType |
JobVariableType | |
newValue |
string |
Returns
- bool
Remarks
TrySet attempts to convert the provided string value to the type specified by varType. If this succeeds, the VariableType and Value are updated and the method returns True. Otherwise the variable is not updated and the method returns false.
ValidForType(JobVariableType, string)
Determines whether a string value can be converted to the specified variable type
public static bool ValidForType(JobVariableType variableType, string value)
Parameters
| Name | Type | Description |
|---|---|---|
variableType |
JobVariableType | |
value |
string |
Returns
- bool
ValueAsObject(IJobVariable)
Gets the Value as an object of the type specified by the VariableType.
public static object ValueAsObject(IJobVariable variable)
Parameters
| Name | Type | Description |
|---|---|---|
variable |
IJobVariable |
Returns
- object