/// <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);
        }
예제 #2
0
 public void SetValue(TimeSpan value)
 {
     this.SetObjectValue(value);
     this.DataType = FactorDataType.TIMESPAN;
 }
예제 #3
0
 public void SetValue(Regex value)
 {
     this.SetObjectValue(value);
     this.DataType = FactorDataType.REGEX;
 }
예제 #4
0
 public void SetValue(DateTime value)
 {
     this.SetObjectValue(value);
     this.DataType = FactorDataType.DATETIME;
 }
예제 #5
0
 public void SetValue(string value)
 {
     this.SetObjectValue(value);
     this.DataType = FactorDataType.STRING;
 }
예제 #6
0
 public void SetValue(double value)
 {
     this.SetDoubleValue(value);
     this.DataType = FactorDataType.DOUBLE;
 }
예제 #7
0
 public void SetValue(long value)
 {
     this.SetLongValue(value);
     this.DataType = FactorDataType.LONG;
 }
예제 #8
0
 public void SetValue(int value)
 {
     this.SetLongValue(value);
     this.DataType = FactorDataType.INT;
 }
예제 #9
0
 public void SetValue(bool value)
 {
     this.SetLongValue(value ? 1 : 0);
     this.DataType = FactorDataType.BOOL;
 }