예제 #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;
 }
예제 #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;
        }
예제 #3
0
 /// <summary>
 /// Define base record type
 /// </summary>
 public RecordTypeBuilder SetBaseType(String baseType)
 {
     _baseTypeResolver = new TypeResolver(baseType);
     return this;
 }
예제 #4
0
 /// <summary>
 /// Define base record type
 /// </summary>
 public RecordTypeBuilder SetBaseType(TypeResolver baseTypeResolver)
 {
     _baseTypeResolver = baseTypeResolver;
     return this;
 }
예제 #5
0
 public RecordTypeBuilder AddField(Int32 index, String name, TypeResolver typeResolver, FieldQualifier qualifier, Object defaultValue)
 {
     AddFieldInternal(index, name, typeResolver, qualifier, defaultValue);
     return this;
 }