Exemple #1
0
        public void SetProperty(int rowNumber, int code, Features? entityType, object value)
        {
            if (code <= MAX_COMMON_PROPERTY_ID)
                entityType = null;

            var key = new PropertyInfoId(code, entityType);
            if (PropertyDefinition.ContainsKey(key))
            {
                var propertyName = PropertyDefinition[key].PropertyName;
                if (!String.IsNullOrWhiteSpace(propertyName))
                {
                    var type = this.GetType();
                    var prop = type.GetProperty(propertyName);
                    prop.SetValue(this, value);

                    DebugInfo.Add(new Tuple<string, int>(propertyName, rowNumber));
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets the data length. 
        /// Returns Constants.PROPERTY_SPECIAL_LENGTH_VALUE if the length must be computed.
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public static FieldSizes? GetDataLength(int code, Features? entityType)
        {
            if (code <= MAX_COMMON_PROPERTY_ID)
                entityType = null;

            var key = new PropertyInfoId(code, entityType);
            if (PropertyDefinition.ContainsKey(key))
            {
                return PropertyDefinition[key].Length;
            }
            else
            {
                return null;
            }
        }