Class MultiValueTextElement

Class MultiValueTextElement

Namespace: Aspose.Medical.Dicom.Elements
Assembly: Aspose.Medical.dll (25.11.0)

Encapsulates basic functionality for multi-value text VR types (doesn’t support charset customization).

public abstract class MultiValueTextElement : TextElement, IElement

Inheritance

object TextElement MultiValueTextElement

Derived

AgeString , ApplicationEntity , CodeString , EncodableMultiValuedTextElement , MultiValueDateTextElement<t> , NumericMultiValueTextElement<t> , UniqueIdentifier

Implements

IElement

Inherited Members

TextElement.Get<t>(int) , TextElement.Get<t>(Index) , TextElement.GetOrDefault<t>(int) , TextElement.GetOrDefault<t>(Index) , TextElement.GetValues<t>() , TextElement.GetValues<t>(Range) , TextElement.TryGetValue<t>(int, out T?) , TextElement.TryGetValue<t>(Index, out T?) , TextElement.Accept(Walker) , TextElement.AcceptAsync(AsyncWalker) , TextElement.GetUntypedData() , TextElement.ParseAs<t>(string, out T?) , TextElement.Count , TextElement.Tag , TextElement.ValueRepresentation , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

MultiValueTextElement(Tag, Span<string>, ValueRepresentation, bool)

Initializes a new instance of the Aspose.Medical.Dicom.Elements.MultiValueTextElement.

protected MultiValueTextElement(Tag tag, Span<string> data, ValueRepresentation vr, bool skipValidation = false)

Parameters

tag Tag

Element’s tag.

data Span < string &gt;

Element’s values.

vr ValueRepresentation

Value Representation of a Value Element.

skipValidation bool

Indicates whether the validation should be skipped (if true) or not.

Exceptions

DicomValidationException

The provided data are invalid.

Properties

Count

The number of elements contained in this element. Read-only System.Int32.

public override int Count { get; }

Property Value

int

Data

Multivalued Data Element value. Read-only System.Collections.Generic.IReadOnlyCollection`1 of System.String.

public string[] Data { get; }

Property Value

string []

Methods

Add(string)

Adds the given value to the collection of values of this element.

public void Add(string value)

Parameters

value string

A value to be added to this element.

Exceptions

DicomValidationException

The value is invalid or Value Multiplicity restriction is violated.

AddRange(IEnumerable<string>)

Adds the given values to the collection of values of this element.

public void AddRange(IEnumerable<string> values)

Parameters

values IEnumerable < string &gt;

Values to be added to this element.

Exceptions

DicomValidationException

The values are invalid or Value Multiplicity restriction is violated.

Get<t>(int)

Returns the element’s value at the specified position.

public override T Get<t>(int index)

Parameters

index int

The zero-based index of the element to retrieve.

Returns

T

The T value.

Type Parameters

T

Type of the return value.

Exceptions

IndexOutOfRangeException

index is negative or not less than Aspose.Medical.Dicom.Elements.MultiValueTextElement.Count.

MedicalApiException

Value can’t be converted to the specified type.

Get<t>(Index)

Returns the element’s value at the specified position.

public override T Get<t>(Index index)

Parameters

index Index

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

Returns

T

The T value.

Type Parameters

T

Type of the return value.

Exceptions

IndexOutOfRangeException

index is negative or not less than Aspose.Medical.Dicom.Elements.MultiValueTextElement.Count.

MedicalApiException

Value can’t be converted to the specified type.

GetOrDefault<t>(int)

Returns the element’s value at the specified position or a default value if the index is out of range.

public override T? GetOrDefault<t>(int index)

Parameters

index int

The zero-based index of the element value to retrieve.

Returns

T?

The T value.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Value can’t be converted to the specified type.

GetOrDefault<t>(Index)

Returns the element’s value at the specified position or a default value if the index is out of range.

public override T? GetOrDefault<t>(Index index)

Parameters

index Index

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

Returns

T?

The T value.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Value can’t be converted to the specified type.

GetUntypedData()

Returns this text element data as a collection of untyped (System.Object) elements.

protected override sealed IEnumerable<object> GetUntypedData()

Returns

IEnumerable < object &gt;

The collection of untyped element data.

GetValues<t>()

Returns the element’s values.

public override Span<t> GetValues<t>()

Returns

Span <t>

The element’s data.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Value can’t be converted to the specified type.

GetValues<t>(Range)

Returns the element’s values at the specified range.

public override Span<t> GetValues<t>(Range range)

Parameters

range Range

The range of the element values to retrieve.

Returns

Span <t>

The element’s data.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Value can’t be converted to the specified type.

Insert(int, string)

Inserts the given value into this element at a given index. The size of the list is increased by one.

public void Insert(int index, string value)

Parameters

index int

The zero-based index at which value should be inserted.

value string

A value to be inserted at the specified index.

Exceptions

DicomValidationException

The value is invalid or Value Multiplicity restriction is violated.

Remove(string)

Removes the first occurrence of a specific value from the element.

public bool Remove(string value)

Parameters

value string

The object to remove from the element.

Returns

bool

true if value is successfully removed; otherwise, false. This method also returns false if value was not found in the element.

Exceptions

DicomValidationException

Number of values does not match Value Multiplicity.

RemoveAt(int)

Removes the value at the specified index of the element.

public void RemoveAt(int index)

Parameters

index int

The zero-based index of the element to remove.

Exceptions

DicomValidationException

Number of values does not match Value Multiplicity.

Replace(IEnumerable<string>)

Replaces the current values by the collection of the given values.

public void Replace(IEnumerable<string> values)

Parameters

values IEnumerable < string &gt;

Values to be set to this element.

Exceptions

DicomValidationException

The values are invalid or Value Multiplicity restriction is violated.

ToString()

public override string ToString()

Returns

string

TryGetValue<t>(int, out T?)

Gets the element’s value at the specified position.

public override bool TryGetValue<t>(int index, out T? value)

Parameters

index int

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

value T?

When this method returns, contains the value at the specified position (index); otherwise, contains the default value for the type of the value parameter.

Returns

bool

true if the element value could be extracted; otherwise, false.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Value can’t be converted to the specified type.

TryGetValue<t>(Index, out T?)

Gets the element’s value at the specified position.

public override bool TryGetValue<t>(Index index, out T? value)

Parameters

index Index

The index of the element value to retrieve, which is either from the beginning or the end of the sequence.

value T?

When this method returns, contains the value at the specified position (index); otherwise, contains the default value for the type of the value parameter.

Returns

bool

true if the element value could be extracted; otherwise, false.

Type Parameters

T

Type of the return value.

Exceptions

MedicalApiException

Only System.String return type is supported. </t></t></string></t></t></t></t></t></t></t></t></string></string></t></t></t></t></t></t></t></t></t></t></t>