
# IServerView interface

The `IServerView` interface is the ancestor interface for a document or panel view object interface.

```csharp
public interface IServerView : IExternalForm
```

**Namespace:** DXP · **Assembly:** Altium.SDK.Interfaces

**Inherits:** [IExternalForm](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md)

**Derived:** [ICategorizedServerView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/ICategorizedServerView.md), [IEDesignDataPanelView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IEDesignDataPanelView.md), [IServerDocumentView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerDocumentView.md)

## Remarks

This `IServerView` interface also represents a global panel in Altium Designer, for example the Messages or ToDo panels.

`IServerView` interface

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [ViewState](#viewstate) | `string` | get; set |  |

### ViewState

*No description yet.*

```csharp
string GetViewState();
void SetViewState(string argstate);
```

**Type:** `string` · **Access:** read/write

**See also:** [IClient](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md), [IExternalForm](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md)

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [GetFavoritesViewState](#getfavoritesviewstate) | `string` |  |
| [GetIsPanel](#getispanel) | `bool` | The IsPanel property determines whether the [`IServerDocumentView`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerDocumentView.md) object is a panel or not. |
| [GetViewName](#getviewname) | `string` | The ViewName property represents the view name and is not the same as the document filename. |
| [ReceiveNotification](#receivenotification) | `void` | The `ReceiveNotification` method captures the notification generated by Altium Designer. |
| [SetFavoritesViewState](#setfavoritesviewstate) | `void` |  |

### GetFavoritesViewState

*No description yet.*

```csharp
string GetFavoritesViewState(bool argAddFavoriteView);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argAddFavoriteView` | `bool` | value |

**Returns:** `string`

### GetIsPanel

The IsPanel property determines whether the [`IServerDocumentView`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerDocumentView.md) object is a panel or not. A [`IServerDocument`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerDocument.md) container stores [`IServerDocumentView`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerDocumentView.md) objects and they are can be a panel view or a document view.

```csharp
bool GetIsPanel();
```

**Returns:** `bool`

This property is supported by the `GetIsPanel` method.

The IsPanel property returns a boolean value denoting whether the view is a panel or a document view.

A document consists of a document view and at least one panel view. There also can be global or system views such as Message panel which is a global panel view.

This read only property is supported by the `GetIsPanel` method.

**Example:** Show the file name of the current document when its view is not a panel.

```csharp
using DXP;

IServerDocument serverDocument = DXP.GlobalVars.Client.GetCurrentView()?.GetOwnerDocument();
if (serverDocument == null)
    return;

IServerDocumentView serverDocumentView = serverDocument.GetView(0);
if (!serverDocumentView.GetIsPanel())
    DXP.Utils.ShowMessage("Document Name " + serverDocument.GetFileName());
```

**See also:** [IClient](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md), [IExternalForm](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md)

### GetViewName

The ViewName property represents the view name and is not the same as the document filename. A view can be a global panel that can be seen globally within Altium Designer, as a document view or as a panel view.

```csharp
string GetViewName();
```

**Returns:** `string`

This read only property is supported by the `GetViewName` method.

For example a library document open in Altium Designer yields the following information:

View Name: PCBEditor

Document Name: C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib

Caption: PCBView_GraphicalForm

ViewName example

This code snippet uses the Client.CurrentView.ViewName method to find out the current document's type name.

**Example:** Continue only when the current view is a PCB library.

```csharp
using DXP;

IServerDocumentView currentView = DXP.GlobalVars.Client.GetCurrentView();
if (currentView == null)
    return;
if (currentView.GetViewName() != "PCBLib".ToUpper())
    return;
```

**See also:** [IClient](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md), [IExternalForm](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md)

### ReceiveNotification

The `ReceiveNotification` method captures the notification generated by Altium Designer. A global panel, a document view or a panel view has the ability to intercept a notification and take action accordingly.

```csharp
void ReceiveNotification(INotification argNotification);
void ReceiveNotification(object argNotification);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argNotification` | [INotification](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/INotification.md) | value |

**Returns:** nothing (`void`)

The first overload is an extension method of `IServerViewHelper` (`using DXP;`) with typed parameters; the second is declared by the interface.

**See also:** [IClient](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md), [INotification](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/INotification.md)

### SetFavoritesViewState

*No description yet.*

```csharp
void SetFavoritesViewState(string argstate);
```

| Parameter | Type | Passing |
| --- | --- | --- |
| `argstate` | `string` | value |

**Returns:** nothing (`void`)

## Inherited members

- From [IExternalForm](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md): [FocusFirstTabStop](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#focusfirsttabstop), [GetBounds](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#getbounds), [GetCaption](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#getcaption), [GetHandle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#gethandle), [Hide](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#hide), [ParentWindowCreated](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#parentwindowcreated), [ParentWindowDestroyed](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#parentwindowdestroyed), [SetBounds](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#setbounds), [SetFocus](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#setfocus), [SetParentWindow](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#setparentwindow), [Show](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IExternalForm.md#show)

## Returned by

[IClient.GetServerViewFromName](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md#getserverviewfromname), [IServerModule.CreateServerView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerModule.md#createserverview), [IServerModule.GetViews](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerModule.md#getviews)

## Accepted by

[IClient.AddServerView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md#addserverview), [IClient.RemoveServerView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IClient.md#removeserverview), [IServerModule.AddServerView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerModule.md#addserverview), [IServerModule.RemoveServerView](https://altiumdeveloper.github.io/ad-sdk-docs/reference/dxp/IServerModule.md#removeserverview)
