public new static IAsyncResult BeginOpen(string fileName, AsyncCallback callback, object state) { var df = new DicomStructuredReport(); // reset datasets df.FileMetaInfo.Clear(); df.Dataset.Clear(); df.File = new FileReference(fileName); FileByteSource source = new FileByteSource(df.File); EventAsyncResult result = new EventAsyncResult(callback, state); DicomFileReader reader = new DicomFileReader(); var datasetObserver = new DicomDatasetReaderObserver(df.Dataset); reader.BeginRead(source, new DicomDatasetReaderObserver(df.FileMetaInfo), datasetObserver, OnReadComplete, new Tuple <DicomFileReader, DicomStructuredReport, EventAsyncResult>(reader, df, result)); return(result); }
public new static IAsyncResult BeginOpen(string fileName, Encoding fallbackEncoding, AsyncCallback callback, object state) { var df = new DicomDirectory(); // reset datasets df.FileMetaInfo.Clear(); df.Dataset.Clear(); df.File = new FileReference(fileName); FileByteSource source = new FileByteSource(df.File); EventAsyncResult result = new EventAsyncResult(callback, state); DicomFileReader reader = new DicomFileReader(); var datasetObserver = new DicomDatasetReaderObserver(df.Dataset, fallbackEncoding); var dirObserver = new DicomDirectoryReaderObserver(df.Dataset); reader.BeginRead(source, new DicomDatasetReaderObserver(df.FileMetaInfo), new DicomReaderMultiObserver(datasetObserver, dirObserver), OnReadComplete, new Tuple <DicomFileReader, DicomDirectory, DicomDirectoryReaderObserver, EventAsyncResult>(reader, df, dirObserver, result)); return(result); }
public static IAsyncResult BeginOpen(string fileName, AsyncCallback callback, object state) { DicomFile df = new DicomFile(); df.File = new FileReference(fileName); FileByteSource source = new FileByteSource(df.File); EventAsyncResult async = new EventAsyncResult(callback, state); DicomFileReader reader = new DicomFileReader(); reader.BeginRead(source, new DicomDatasetReaderObserver(df.FileMetaInfo), new DicomDatasetReaderObserver(df.Dataset), OnReadComplete, new Tuple <DicomFileReader, DicomFile, EventAsyncResult>(reader, df, async)); return(async); }