DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomAssociation Class / Dispose Method
Example

In This Topic
    Dispose Method (DicomAssociation)
    In This Topic
    Releases the resources used by the DicomAssociation object
    Syntax
    'Declaration
     
    
    Public Overridable Sub Dispose() 
    public virtual void Dispose()
    Example
    using DicomObjects;
    using DicomObjects.DicomUIDs;
                	    
    /* 
     * If you use:
     * using (var cn = new DicomAssociation()) 
     * {
     *       ...
     * }
     * then the using block will automatically call cn.Dispose() at the end   
     */
       var cn = new DicomAssociation();  
       cn.RequestedContexts.Add(SOPClasses.Verification);
       cn.Open("localhost", 104, "callingAET", "calledAET");
       cn.Echo();  
       
       // Dispose() performs Close() internally, so there's no need to call Close() separately
       cn.Dispose();
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also