LEADTOOLS Medical (Leadtools.Dicom assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
OnInsertFile Method
See Also 
Leadtools.Dicom Namespace > DicomDir Class : OnInsertFile Method



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.
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.
Called for each DICOM file enumerated by the DicomDir.InsertFile method.

Syntax

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
Dim instance As DicomDir
Dim fileName As String
Dim dataSet As DicomDataSet
Dim status As DicomDirInsertFileStatus
Dim error As DicomExceptionCode
Dim value As DicomDirInsertFileCommand
 
value = instance.OnInsertFile(fileName, dataSet, status, 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.

Example

For an example, refer to DicomDir.Reset.

Remarks

If the parameter passed to DicomDir.InsertFile is a null reference (Nothing in Visual Basic), then all the files in the destination folder, and optionally all the files in the subfolders of the destination folder, will be enumerated. For each file, the callback method DicomDir.OnInsertFile is called once or twice:

If this method returned DicomDirInsertFileCommand.Stop, the method DicomDir.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 DicomDir.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.

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

Leadtools.Dicom requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features