예제 #1
0
 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);
         }
     }
 }
예제 #2
0
 protected StdfRecord()
 {
     attribute     = GetStdfRecordAttribute(GetType());
     fieldRegistry = new FieldRegistry();
     header        = new StdfHeader();
 }
예제 #3
0
        /// <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));
        }