Class SingleValueTextElement

Class SingleValueTextElement

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

Encapsulates basic functionality for single-valued text VR types that customizable charset.

public abstract class SingleValueTextElement : TextElement, IElement

Inheritance

object TextElement SingleValueTextElement

Derived

LongText , ShortText , UniversalResource , UnlimitedText

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

SingleValueTextElement(Tag, string, ValueRepresentation, Encoding[], bool)

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

protected SingleValueTextElement(Tag tag, string data, ValueRepresentation vr, Encoding[] encodings, bool skipValidation)

Parameters

tag Tag

Element’s tag.

data string

Element’s values.

vr ValueRepresentation

Value Representation of an element.

encodings Encoding []

A collection of specific character set used to encode / decode this text element data.

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

Text element value. Read/Write System.String.

public string Data { get; set; }

Property Value

string

Exceptions

DicomValidationException

The provided data are invalid.

SerializationEncodings

A collection of specific character set used to serialize / deserialize this text element data. Read/Write System.Collections.Generic.IReadOnlyCollection`1 of System.Text.Encoding.

public IReadOnlyCollection<encoding> SerializationEncodings { get; set; }

Property Value

IReadOnlyCollection < Encoding &gt;

Methods

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

ArgumentOutOfRangeException

For ‘Single Value Text Element’ index must be 0.

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

ArgumentOutOfRangeException

For ‘Single Value Text Element’ index must be 0.

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.

ArgumentOutOfRangeException

Only ranges with offset = 0 and length = 1 are supported.

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

Value can’t be converted to the specified type. </t></t></t></t></t></t></t></t></t></t></t></t></t></t></t></t></t></t></t>