# OpcAddressSpace Members

> Reference: Represents the address space which the callback of an OpcServer (e.g. OpcServer) receives to create the nodes of the server.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcAddressSpace</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

## Properties

### DefaultNamespace

Gets the default namespace of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNamespace DefaultNamespace { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property DefaultNamespace As OpcNamespace
```

</div>

**Property value**

[OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/)

The [DefaultNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/members#defaultnamespace) of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

### DefaultNamespaceIndex

Gets the index of the default namespace of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

<div class="api-signature" data-lang="csharp">

```csharp
public int DefaultNamespaceIndex { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property DefaultNamespaceIndex As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The [DefaultNamespaceIndex](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/members#defaultnamespaceindex) of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

### DefaultNamespaceUri

Gets the URI of the default namespace of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

<div class="api-signature" data-lang="csharp">

```csharp
public Uri DefaultNamespaceUri { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property DefaultNamespaceUri As Uri
```

</div>

**Property value**

[Uri](https://learn.microsoft.com/dotnet/api/system.uri)

The [DefaultNamespaceUri](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/members#defaultnamespaceuri) of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

### Manager

Gets the node manager which creates the nodes of the address space.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeManager Manager { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Manager As OpcNodeManager
```

</div>

**Property value**

[OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/)

The [OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/) which adds the [Nodes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#nodes) to the server.

### Namespaces

<span class="api-meta">since v2.8</span>

Gets the namespaces maintained by the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcReadOnlyNamespaceCollection Namespaces { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Namespaces As OpcReadOnlyNamespaceCollection
```

</div>

**Property value**

[OpcReadOnlyNamespaceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynamespacecollection/)

The [Namespaces](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/members#namespaces) of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

### Nodes

Gets the nodes to add to the address space.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeCollection Nodes { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Nodes As OpcNodeCollection
```

</div>

**Property value**

[OpcNodeCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodecollection/)

An [OpcNodeCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodecollection/) which initially contains the [Nodes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/members#nodes) of the [Manager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#manager).

### References

Gets the references of the nodes to their parent nodes.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeReferenceCollection References { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property References As OpcNodeReferenceCollection
```

</div>

**Property value**

[OpcNodeReferenceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencecollection/)

The [OpcNodeReferenceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodereferencecollection/) which the server uses to link the [Nodes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#nodes) into its address space.

## Methods

### AddNode

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [AddNode(IOpcNode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#addnode-opc-uafx-iopcnode) | Adds the `node` specified to the address space below the 'Objects' folder (see [ObjectsFolder](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjecttypes/members#objectsfolder)). |
| [AddNode(IOpcNode, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#addnode-opc-uafx-iopcnode-opc-uafx-opcnodeid) | Adds the `node` specified to the address space below the parent node with the `parentNodeId` specified. |

#### AddNode(IOpcNode)

Adds the `node` specified to the address space below the 'Objects' folder (see [ObjectsFolder](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjecttypes/members#objectsfolder)).

<div class="api-signature" data-lang="csharp">

```csharp
public void AddNode(IOpcNode node)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub AddNode(node As IOpcNode)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `node` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) to add. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `node` is a null reference (Nothing in Visual Basic). |

**Remarks**

A node which is already part of the [Nodes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#nodes) is not added again.

#### AddNode(IOpcNode, OpcNodeId)

Adds the `node` specified to the address space below the parent node with the `parentNodeId` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public void AddNode(IOpcNode node, OpcNodeId parentNodeId)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub AddNode(node As IOpcNode, parentNodeId As OpcNodeId)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `node` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) to add. |
| `parentNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the parent node. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `node` or `parentNodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

A node which is already part of the [Nodes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#nodes) is not added again. A type node is added without a reference to the parent node. If [AssignDefaultNamespaceOfManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcautomatism/members#assigndefaultnamespaceofmanager) is true, a node without namespace information is linked to the [DefaultNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaddressspace/members#defaultnamespace).

### RemoveNode

Removes the `node` specified and its reference to the parent node from the address space.

<div class="api-signature" data-lang="csharp">

```csharp
public void RemoveNode(IOpcNode node)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub RemoveNode(node As IOpcNode)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `node` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) to remove. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `node` is a null reference (Nothing in Visual Basic). |
