Exemple #1
0
        /// <summary>
        /// Split existing fields into different field types.
        /// </summary>
        private void InitFields()
        {
            Int32 fieldIndex;

            // Init field holders.
            _fieldArray = new FactorField[FactorManager.GetFactorFieldMaxCount()];
            for (fieldIndex = 0; fieldIndex < FactorManager.GetFactorFieldMaxCount(); fieldIndex++)
            {
                _fieldArray[fieldIndex] = null;
            }
            _mainField         = null;
            _substantialFields = new FactorFieldList();

            // Add information to field holders.
            foreach (FactorField field in Fields)
            {
                _fieldArray[field.Index] = field;
                if (field.IsSubstantial)
                {
                    _substantialFields.Add(field);
                }
                if (field.IsMain)
                {
                    _mainField = field;
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Create a FactorDataType instance.
 /// </summary>
 /// <param name="id">Id of the factor data type</param>
 /// <param name="sortOrder">Sorting order of the factor data type</param>
 /// <param name="name">Name of the factor data type</param>
 /// <param name="definition">Definition of the factor data type</param>
 /// <param name="fields">Fields for this factor data type</param>
 public FactorDataType(Int32 id,
                       Int32 sortOrder,
                       String name,
                       String definition,
                       FactorFieldList fields)
     : base(id, sortOrder)
 {
     _name       = name;
     _definition = definition;
     _fields     = fields;
     InitFields();
 }