# OdgLayers

Layers declared in one document, master, or page scope. Adding a layer set overrides inherited layers in that scope.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`15caddadea70` with working tree changes

**Source**

[OdgLayers.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgLayers.cs#L69)

**Implements**

`IReadOnlyList<OdgLayer>` `IReadOnlyCollection<OdgLayer>` `IEnumerable<OdgLayer>` `IEnumerable`

**Modifiers**

sealed

**Attributes**

`DefaultMember("Item")`

Layers declared in one document, master, or page scope. Adding a layer set overrides inherited layers in that scope.

## Inheritance

- object
- OdgLayers

## Usage

Explore 5 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 5

- Property [OdgDocument.Layers](/api/open-document/officeimo-opendocument-odgdocument/#property-layers)
- Property [OdgMasterPage.Layers](/api/open-document/officeimo-opendocument-odgmasterpage/#property-layers)
- Property [OdgPage.EffectiveLayers](/api/open-document/officeimo-opendocument-odgpage/#property-effectivelayers)
- Property [OdgPage.Layers](/api/open-document/officeimo-opendocument-odgpage/#property-layers)
- Property [OdgPage.MasterLayers](/api/open-document/officeimo-opendocument-odgpage/#property-masterlayers)

Filter members 

Show inherited

## Methods

`public OdgLayer Add(string name, OdgLayerDisplay display = Always)` [#](#method-add-string-officeimo-opendocument-odglayerdisplay)

[OdgLayers.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgLayers.cs#L72)

Adds a uniquely named layer. Invalid legacy masks leave the existing layer set and saved views unchanged.

Parameters

**name string required**

**display OfficeIMO.OpenDocument.OdgLayerDisplay = Always optional**

Returns

`OdgLayer`

`public OdgLayer? Find(string name)` [#](#method-find-string)

[OdgLayers.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgLayers.cs#L69)

Finds a layer by its case-sensitive identifier.

Parameters

**name string required**

Returns

`OdgLayer?`

`public IEnumerator<OdgLayer> GetEnumerator()` [#](#method-getenumerator)

[OdgLayers.cs:95](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgLayers.cs#L95)

Returns an enumerator that iterates through the collection.

Returns

`IEnumerator<OdgLayer>` An enumerator that can be used to iterate through the collection.

## 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 int Count { get; }` [#](#property-count)

[OdgLayers.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgLayers.cs#L65)

Number of declared layers.

`public OdgLayer this[int index] { get; }` [#](#property-item-int32)

[OdgLayers.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgLayers.cs#L67)

A layer at a zero-based position.

Parameters

**index int required**

<!-- PowerForge markdown artifact sha256:41C705A1C03106852162C084EBA4C71379057EC04B1C1BA2097E8C57C07C2DF9 -->
