public event EventHandler<BeforeAddElementEventArgs> BeforeAddElement
public:
event EventHandler<BeforeAddElementEventArgs^>^ BeforeAddElement
The event handler receives an argument of type BeforeAddElementEventArgs containing data related to this event. The following BeforeAddElementEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from System.ComponentModel.CancelEventArgs) | Gets or sets a value indicating whether the event should be canceled. |
Element | The dynamic property that represents the element. |
using Leadtools.Dicom.Common.DataTypes;
using Leadtools.Dicom.Common.Extensions;
using Leadtools.Dicom;
using Leadtools.Dicom.Common.Editing.Converters;
using Leadtools.Dicom.Common.Editing;
public void TestEditableObject()
{
DicomEditableObject dcmObject = new DicomEditableObject();
DicomDataSet ds = null;
string dicomFileNameIn = Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "image2.dcm");
DicomEngine.Startup();
ds = new DicomDataSet();
ds.Load(dicomFileNameIn, DicomDataSetLoadFlags.None);
dcmObject.BeforeAddElement += new EventHandler<BeforeAddElementEventArgs>(dcmObject_BeforeAddElement);
dcmObject.DataSet = ds;
Console.WriteLine("Root Element Count: " + dcmObject.Elements.Count.ToString());
//
// At this point the object can be assigned to a property grid.
//
DicomEngine.Shutdown();
}
void dcmObject_BeforeAddElement(object sender, BeforeAddElementEventArgs e)
{
Console.WriteLine(e.Element.Name);
Console.WriteLine(e.Element.DicomElement.VR.ToString());
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document