# AdfMark

An ADF text mark such as strong, emphasis, code, or link.

Class 

`OfficeIMO.Adf`

**Namespace**

`OfficeIMO.Adf`

**Assembly**

`OfficeIMO.Adf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[AdfDocument.cs:183](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L183)

**Modifiers**

sealed

An ADF text mark such as strong, emphasis, code, or link.

## Inheritance

- object
- AdfMark

## Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [AdfMark.SetAttribute``1](/api/adf/officeimo-adf-adfmark/#method-setattribute-string)
- Property [AdfNode.Marks](/api/adf/officeimo-adf-adfnode/#property-marks)

### Accepted by parameters 1

- Method [AdfNode.TextNode](/api/adf/officeimo-adf-adfnode/#method-textnode-string-collections-generic-ienumerable-officeimo-adf-adfmark) parameter `marks`

Filter members 

Show inherited

## Constructors

`public AdfMark(string type)` [#](#constructor-ctor-string)

[AdfDocument.cs:183](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L183)

Creates an ADF mark.

Parameters

**type string required**

## Methods

`public string? GetStringAttribute(string name)` [#](#method-getstringattribute-string)

[AdfDocument.cs:228](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L228)

Gets a string attribute when present.

Parameters

**name string required**

Returns

`string?`

SetAttribute``1 2 overloads

`public AdfMark SetAttribute<T>(string name, T? value)` [#](#method-setattribute-string)

[AdfDocument.cs:213](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L213)

Sets a JSON-compatible mark attribute.

Type Parameters

**T**

Parameters

**name string required**

**value T? required**

Returns

`AdfMark`

`public AdfMark SetAttribute<T>(string name, T? value, JsonTypeInfo<T?> typeInfo)` [#](#method-setattribute-string-text-json-serialization-metadata-jsontypeinfo)

[AdfDocument.cs:220](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L220)

Sets a custom mark attribute using source-generated JSON metadata.

Type Parameters

**T**

Parameters

**name string required**

**value T? required**

**typeInfo System.Text.Json.Serialization.Metadata.JsonTypeInfo<T?> required**

Returns

`AdfMark`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Type { get; set; }` [#](#property-type)

[AdfDocument.cs:189](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L189)

Mark type.

`public bool IncludeEmptyAttributes { get; set; }` [#](#property-includeemptyattributes)

[AdfDocument.cs:192](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L192)

Includes an empty attributes object when no attributes are set. Parsing retains explicit source presence.

`public IDictionary<string, JsonElement> Attributes { get; }` [#](#property-attributes)

[AdfDocument.cs:196](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L196)

Mark attributes retained as arbitrary JSON values.

`public IDictionary<string, JsonElement> ExtensionData { get; }` [#](#property-extensiondata)

[AdfDocument.cs:200](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Adf/AdfDocument.cs#L200)

Unknown mark properties retained during parse/write round trips.

<!-- PowerForge markdown artifact sha256:4EA75043B7F29731CD695898A74EE79F66FDBF02B4BEFCBBD5C9EF4E2E5F5D37 -->
