private static void RegisterRecords(Type[] types, StringBuilder s) { foreach (Type type in types) { if (type.IsSubclassOf(typeof(StdfRecord)) && (!type.IsAbstract)) { StdfRecordAttribute attribute = StdfRecord.GetStdfRecordAttribute(type); if (attribute == null) { if (s.Length > 0) { s.Append(", "); } s.Append(type.Name); continue; } Instance.RegisterRecord(attribute.Type, attribute.Subtype, type); } } }
protected StdfRecord() { attribute = GetStdfRecordAttribute(GetType()); fieldRegistry = new FieldRegistry(); header = new StdfHeader(); }
/// <summary> /// Creates a STDF record instance of the specified <code>Type</code>. /// </summary> /// <param name="recordType"> /// A <see cref="Type"/> which represents the type of <code>StdfRecord</code>. /// </param> /// <returns> /// A <see cref="StdfRecord"/> which represents the instance of the record. /// </returns> public StdfRecord CreateRecord(Type recordType) { StdfRecordAttribute attribute = StdfRecord.GetStdfRecordAttribute(recordType); return(CreateRecord(attribute.Type, attribute.Subtype)); }