Visual Basic (Declaration) | |
---|---|
Public Overridable Function OnInsertFile( _ ByVal fileName As String, _ ByVal dataSet As DicomDataSet, _ ByVal status As DicomDirInsertFileStatus, _ ByVal error As DicomExceptionCode _ ) As DicomDirInsertFileCommand |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public virtual DicomDirInsertFileCommand OnInsertFile( string fileName, DicomDataSet dataSet, DicomDirInsertFileStatus status, DicomExceptionCode error ) |
Managed Extensions for C++ | |
---|---|
public: virtual DicomDirInsertFileCommand OnInsertFile( string* fileName, DicomDataSet* dataSet, DicomDirInsertFileStatus status, DicomExceptionCode error ) |
C++/CLI | |
---|---|
public: virtual DicomDirInsertFileCommand OnInsertFile( String^ fileName, DicomDataSet^ dataSet, DicomDirInsertFileStatus status, DicomExceptionCode error ) |
Parameters
- fileName
- The name of the file being added to the DICOM Directory.
- dataSet
- A DicomDataSet object that specifies the Data Set contained by the DICOM file being processed. If the Data Set wasn't loaded successfully, this parameter is set to a null reference (Nothing in Visual Basic).
- status
- The status code.
- error
- The error code. This parameter is always set to DicomExceptionCode.Success unless the parameter status is set to DicomDirInsertFileStatus.Failure.
Return Value
A value indicating how the enumeration of DICOM files should continue.OnInsertFile is called just after trying to load the Data Set in the file and before actually adding the file to the DICOM Directory. If the Data Set was loaded successfully, the parameter dataSet specifies the loaded Data Set and the parameter status is set to DicomDirInsertFileStatus.PreAdd. To skip the addition of the file, OnInsertFile should return DicomDirInsertFileCommand.Skip. If the Data Set wasn't loaded successfully, the parameter dataSet is set to a null reference, the parameter status is set to DicomDirInsertFileStatus.Failure, and the parameter error is set to an error code. OnInsertFile is called the second time just after trying to add the loaded Data Set to the DICOM Directory. The parameter dataSet specifies the loaded Data Set. If the Data Set was added successfully, the parameter status is set to DicomDirInsertFileStatus.Success. Otherwise, it is set to DicomDirInsertFileStatus.Failure and the parameter error is set to an error code. This call to OnInsertFile is not made if a loading failure was reported in the first call, or the file addition was skipped in the first call.
If this method returned DicomDirInsertFileCommand.Stop, the method InsertFile will stop adding new files. Therefore, to keep adding the DICOM files, this method should return DicomDirInsertFileCommand.Continue, or DicomDirInsertFileCommand.Skip if only the current file is to be skipped (which can be done during the first call).
The method InsertFile will stop adding new files and will throw an exception if an error occurred.
The implementation of the DicomDir class for this method simply returns DicomDirInsertFileCommand.Continue. In order to make use of this callback method, you should create a new class derived from the DicomDir class and override the method providing the desired implementation.
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family