/// <summary> /// Convert a WebFactorDataType instance into /// an IFactorDataType instance. /// </summary> /// <param name="userContext"> /// Information about the user that makes this method call. /// </param> /// <param name="webFactorDataType">A WebFactorDataType instance.</param> /// <param name="factorFieldEnumerations">List of factor field enumerations.</param> /// <returns>An IFactorDataType instance.</returns> private IFactorDataType GetFactorDataType(IUserContext userContext, WebFactorDataType webFactorDataType, FactorFieldEnumList factorFieldEnumerations) { IFactorDataType factorDataType = new FactorDataType { DataContext = GetDataContext(userContext), Definition = webFactorDataType.Definition, Id = webFactorDataType.Id, Name = webFactorDataType.Name }; FactorFieldList fields = new FactorFieldList(); foreach (WebFactorField webFactorField in webFactorDataType.Fields) { fields.Add(GetFactorField(userContext, factorDataType, webFactorField, factorFieldEnumerations)); } factorDataType.Fields = fields; int factorFieldMaxCount = CoreData.FactorManager.GetFactorFieldMaxCount(); factorDataType.FieldArray = new IFactorField[factorFieldMaxCount]; for (int i = 0; i < factorFieldMaxCount; i++) { factorDataType.FieldArray[i] = null; } foreach (IFactorField field in factorDataType.Fields) { factorDataType.FieldArray[field.Index] = field; } return(factorDataType); }
public void SetValue(TimeSpan value) { this.SetObjectValue(value); this.DataType = FactorDataType.TIMESPAN; }
public void SetValue(Regex value) { this.SetObjectValue(value); this.DataType = FactorDataType.REGEX; }
public void SetValue(DateTime value) { this.SetObjectValue(value); this.DataType = FactorDataType.DATETIME; }
public void SetValue(string value) { this.SetObjectValue(value); this.DataType = FactorDataType.STRING; }
public void SetValue(double value) { this.SetDoubleValue(value); this.DataType = FactorDataType.DOUBLE; }
public void SetValue(long value) { this.SetLongValue(value); this.DataType = FactorDataType.LONG; }
public void SetValue(int value) { this.SetLongValue(value); this.DataType = FactorDataType.INT; }
public void SetValue(bool value) { this.SetLongValue(value ? 1 : 0); this.DataType = FactorDataType.BOOL; }