Class TextElement

Class TextElement

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

Encapsulates basic functionality for VR types that depend on text encodings.

public abstract class TextElement : IElement

Inheritance

object TextElement

Derived

MultiValueTextElement , SingleValueTextElement

Implements

IElement

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

TextElement(Tag)

Encapsulates basic functionality for VR types that depend on text encodings.

protected TextElement(Tag tag)

Parameters

tag Tag

Properties

Count

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

public abstract int Count { get; }

Property Value

int

Tag

The DICOM tag associated with the element. Read-only Aspose.Medical.Dicom.Elements.IElement.Tag.

public Tag Tag { get; }

Property Value

Tag

ValueRepresentation

The Value Representation of the element. Read-only Aspose.Medical.Dicom.Elements.IElement.ValueRepresentation.

public abstract ValueRepresentation ValueRepresentation { get; }

Property Value

ValueRepresentation

Methods

Accept(Walker)

Dispatches (delegates) a request to the accepted walker.

protected abstract void Accept(Walker walker)

Parameters

walker Walker

A walker to be used for traversal and perform operations.

AcceptAsync(AsyncWalker)

Asynchronously dispatches (delegates) a request to the accepted walker.

protected abstract Task AcceptAsync(AsyncWalker walker)

Parameters

walker AsyncWalker

A walker to be used for traversal and perform operations.

Returns

Task

Get<t>(int)

Returns the element’s value at the specified position.

public abstract 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.

Get<t>(Index)

Returns the element’s value at the specified position.

public abstract 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.

GetOrDefault<t>(int)

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

public abstract 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.

GetOrDefault<t>(Index)

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

public abstract 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.

GetUntypedData()

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

protected abstract IEnumerable<object> GetUntypedData()

Returns

IEnumerable < object &gt;

The collection of untyped element data.

GetValues<t>()

Returns the element’s values.

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

Returns

Span <t>

The element’s data.

Type Parameters

T

Type of the return value.

GetValues<t>(Range)

Returns the element’s values at the specified range.

public abstract 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.

ParseAs<t>(string, out T?)

Converts the given System.String parameter (str) assuming that the T is System.Enum.

protected bool ParseAs<t>(string str, out T? result)

Parameters

str string

Text value to be parsed.

result T?

When this method returns, contains the parsed value; otherwise, contains the default value for the type of the result parameter.

Returns

bool

true if the given str could be parsed as T; otherwise, false.

Type Parameters

T

Type of the return value (must be System.Enum).

Exceptions

MedicalApiException

Value can’t be converted to the specified type.

TryGetValue<t>(int, out T?)

Gets the element’s value at the specified position.

public abstract 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.

TryGetValue<t>(Index, out T?)

Gets the element’s value at the specified position.

public abstract 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. </t></t></t></t></t></t></t></t></t></t></t>