示例#1
0
        /// <summary>
        /// Adds the field to the object.
        /// </summary>
        /// <param name="fldName">Name of the field.</param>
        /// <param name="fldType">The data type for the field.</param>
        /// <param name="dflt">Default value for the field. Used to determine if the field has changed. If null, it is converted to the default value for fieldType.</param>
        /// <returns></returns>
        public BaField Add(string fldName, Type fldType, object dflt)
        {
            if (Fields.ContainsField(fldName))
            {
                throw new ArgumentException("A field already exists with this field name.");
            }
            var fld = new BaField(this, fldName, fldType, dflt);

            Fields.Add(fld);
            return(fld);
        }
示例#2
0
 bool IDictionary <string, object> .ContainsKey(string key)
 {
     return(Fields.ContainsField(key));
 }