Пример #1
0
        /// <summary>
        /// Removes a delegate to be notified when the specified record is read.
        /// </summary>
        /// <param name="recordType">The Type of the record to remove</param>
        /// <exception cref="ObjectDisposedException">If the object is already disposed.</exception>
        public void RemoveDelegate(Type recordType)
        {
            if (disposed)
            {
                throw disposedException;
            }
            CheckRecordType(recordType);
            StdfRecordAttribute attribute = StdfRecord.GetStdfRecordAttribute(recordType);

            RemoveDelegate(attribute.Type, attribute.Subtype);
        }
Пример #2
0
        /// <summary>
        /// Registers a delegate for a specific <code>StdfRecord</code>.
        /// </summary>
        /// <param name="recordType">The record <code>Type</code> for which the delegated is registered.</param>
        /// <param name="recordReadDelegate">The delegate to register.</param>
        /// <exception cref="ArgumentException">If the passed <code>Type</code> is not a subclass of <code>StdfRecord</code>.</exception>
        /// <exception cref="AttributeNotDefinedException">If the <code>StdfRecordAttribute</code> is not defined for the passed record Type.</exception>
        /// <exception cref="ObjectDisposedException">If the object is already disposed.</exception>
        public void RegisterDelegate(Type recordType, RecordReadEventHandler recordReadDelegate)
        {
            if (disposed)
            {
                throw disposedException;
            }
            CheckRecordType(recordType);
            StdfRecordAttribute attribute = StdfRecord.GetStdfRecordAttribute(recordType);

            RegisterDelegate(attribute.Type, attribute.Subtype, recordReadDelegate);
        }
Пример #3
0
        private void ReadRecord(Type recordType, Stream stream)
        {
            StdfRecordAttribute attribute = StdfRecord.GetStdfRecordAttribute(recordType);

            ReadRecords(new RecordInfo[] { new RecordInfo(attribute.Type, attribute.Subtype) }, stream);
        }
Пример #4
0
 internal RecordReadEventArgs(StdfRecord record)
 {
     this.record = record;
     attribute   = StdfRecord.GetStdfRecordAttribute(this.record.GetType());
 }