Beispiel #1
0
 /// <summary>
 /// Protected initialization
 /// </summary>
 public FieldInfo(TypeContext typeContext, Int32 index, String name, TypeResolver typeResolver, FieldQualifier qualifier, Object defaultValue)
 {
     _typeContext = typeContext;
     _index = index;
     _name = name;
     _qualifier = qualifier;
     _typeResolver = typeResolver;
     _defaultValue = defaultValue;
 }
Beispiel #2
0
        protected void AddFieldInternal(Int32 index, String name, TypeResolver typeResolver, FieldQualifier qualifier, Object defaultValue)
        {
            if (_fieldsByName.ContainsKey(name))
                throw new DuplicateFieldNameException("Duplicate field {0} found for record {1}", name, FullName);

            if (_fieldsByIndex.ContainsKey(index))
                throw new DuplicateFieldIndexException("Duplicate field index {0} found for record {1}", index, FullName);

            var fieldInfo = new FieldInfo(_typeContext, index, name, typeResolver, qualifier, defaultValue);

            _fields.Add(fieldInfo);
            _fieldsByName[fieldInfo.Name] = fieldInfo;
            _fieldsByIndex[fieldInfo.Index] = fieldInfo;
        }
 /// <summary>
 /// Define base record type
 /// </summary>
 public RecordTypeBuilder SetBaseType(String baseType)
 {
     _baseTypeResolver = new TypeResolver(baseType);
     return this;
 }
 /// <summary>
 /// Define base record type
 /// </summary>
 public RecordTypeBuilder SetBaseType(TypeResolver baseTypeResolver)
 {
     _baseTypeResolver = baseTypeResolver;
     return this;
 }
 public RecordTypeBuilder AddField(Int32 index, String name, TypeResolver typeResolver, FieldQualifier qualifier, Object defaultValue)
 {
     AddFieldInternal(index, name, typeResolver, qualifier, defaultValue);
     return this;
 }