BeforeAddElementEventArgs Class

Summary
Provides data for the BeforeAddElement event.
Syntax
C#
C++/CLI
public class BeforeAddElementEventArgs : CancelEventArgs 
public ref class BeforeAddElementEventArgs : public System.ComponentModel.CancelEventArgs  
Example
C#
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:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.1.30
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Common Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.