Class DicomServiceApplicationInfo
- Namespace
- FellowOakDicom.Network
- Assembly
- fo-dicom.core.dll
Base class that encapsulates the Service Class Application Information field for the SOP Class Extended Negotiation Sub-item. Inherited classes can implement the application information specific to the Service Class specification identified by the SOP Class UID. See: http://dicom.nema.org/medical/dicom/current/output/chtml/part07/sect_D.3.3.5.html for details on the Service Class Application Information field.
public class DicomServiceApplicationInfo : IEnumerable<KeyValuePair<byte, byte>>, IEnumerable
- Inheritance
-
DicomServiceApplicationInfo
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
DicomServiceApplicationInfo()
Initializes an instance of the DicomServiceApplicationInfo class.
public DicomServiceApplicationInfo()
DicomServiceApplicationInfo(byte[])
Initializes an instance of the DicomServiceApplicationInfo class.
public DicomServiceApplicationInfo(byte[] rawApplicationInfo)
Parameters
rawApplicationInfo
byte[]Raw byte array with the application info
Properties
Count
Gets the number of fields contained in the DicomServiceApplicationInfo.
public int Count { get; }
Property Value
this[byte]
Gets the byte value for given index
.
public byte this[byte index] { get; protected set; }
Parameters
index
byteApplication info field index.
Property Value
- byte
Byte value
Exceptions
- ArgumentException
Invalid field index.
OnCreateApplicationInfo
A delegate to be executed when the application info is created.
public static DicomServiceApplicationInfo.CreateApplicationInfoDelegate OnCreateApplicationInfo { get; set; }
Property Value
Methods
Add(byte, byte)
Add a single application info field value given by index and value.
public void Add(byte index, byte value)
Parameters
Exceptions
- ArgumentException
Invalid field index or a field with same index already exists.
AddOrUpdate(byte, bool)
Add or update a single application info field value given by index and value.
public void AddOrUpdate(byte index, bool value)
Parameters
Exceptions
- ArgumentException
Invalid field index.
AddOrUpdate(byte, byte)
Add or update a single application info field value given by index and value.
public void AddOrUpdate(byte index, byte value)
Parameters
Exceptions
- ArgumentException
Invalid field index.
Contains(byte)
Determines whether the Service Class Application Info contains a field with the specified index.
public bool Contains(byte index)
Parameters
index
byteApplication info field index.
Returns
- bool
True
if exist, otherwiseFalse
Create(DicomUID, byte[])
A factory method to initialize a new application information class based on the provided sop class.
public static DicomServiceApplicationInfo Create(DicomUID sopClass, byte[] rawApplicationInfo)
Parameters
Returns
- DicomServiceApplicationInfo
The application information class.
GetEnumerator()
Returns an enumerator that iterates through the Application Info fields.
public IEnumerator<KeyValuePair<byte, byte>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<byte, byte>>
Enumerator for the Application Info fields.
GetValue(byte)
Get the application info field value.
public byte GetValue(byte index)
Parameters
index
byteApplication info field index.
Returns
- byte
Application info field value.
GetValueAsBoolean(byte, bool)
Get the application info field value as
bool
.
public bool GetValueAsBoolean(byte index, bool defaultValue)
Parameters
index
byteApplication info field index.
defaultValue
boolDefault value if Application info field index does not exist.
Returns
- bool
True
if 1 orFalse
if 0, ordefaultValue
if index does not exist.
GetValueForEnum<T>(byte, byte)
Get the application info field value for enum
of type T.
public byte GetValueForEnum<T>(byte index, byte defaultValue)
Parameters
index
byteApplication info field index.
defaultValue
byteDefault value if Application info field index does not exist.
Returns
- byte
Application info field value or
defaultValue
if not exists.
Type Parameters
T
Enum type to verify values against.
Exceptions
- ArgumentException
T
is not an Enum.
GetValues()
Get the raw Service Class Application Information field.
public byte[] GetValues()
Returns
- byte[]
Service Class Application Information field.
Remove(byte)
Removes the field with the specified index from the Service Class Application Info.
public bool Remove(byte index)
Parameters
index
byteApplication info field index.
Returns
- bool
True
if successful removed,False
otherwise.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.