Exemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Load the field values into the model's data cache.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void LoadFields()
        {
            var factoryFields = FileType.FactoryFields.ToArray();

            _fieldDefsForFile = factoryFields
                                .Union(_fieldGatherer.GetAllFieldsForFileType(FileType)
                                       .Where(f => factoryFields.All(e => e.Key != f.Key)));

            foreach (var field in _fieldDefsForFile)
            {
                if (_includedFieldFilterFunction != null && !_includedFieldFilterFunction(field.Key))
                {
                    continue;
                }

                //TODO: make use of field.ReadOnly

                var fieldValue = new FieldInstance(field.Key, _file.GetStringValue(field.Key, string.Empty));
                RowData.Add(fieldValue);
            }
        }
Exemplo n.º 2
0
        private static string GetFieldValue(ComponentFile file, string valueName)
        {
            var stringVal = file.GetStringValue(valueName, null);

            return(string.IsNullOrEmpty(stringVal) ? null : stringVal);
        }
Exemplo n.º 3
0
 private void RememberPersonId(ComponentFile file)
 {
     _personId   = file.FileName.Substring(0, file.FileName.Length - Settings.Default.PersonFileExtension.Length);
     _personCode = file.GetStringValue(PersonFileType.kCode, null);
 }