Skip to main content
View as Markdown

IServerView interface

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

public interface IServerView : IExternalForm

Namespace: DXP · Assembly: Altium.SDK.Interfaces

Inherits: IExternalForm

Derived: ICategorizedServerView, IEDesignDataPanelView, IServerDocumentView

Remarks​

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

IServerView interface

Properties​

PropertyTypeAccessDescription
ViewStatestringget; set

ViewState​

No description yet.

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

Type: string · Access: read/write

See also: IClient, IExternalForm

Methods​

MethodReturnsDescription
GetFavoritesViewStatestring
GetIsPanelboolThe IsPanel property determines whether the IServerDocumentView object is a panel or not.
GetViewNamestringThe ViewName property represents the view name and is not the same as the document filename.
ReceiveNotificationvoidThe ReceiveNotification method captures the notification generated by Altium Designer.
SetFavoritesViewStatevoid

GetFavoritesViewState​

No description yet.

string GetFavoritesViewState(bool argAddFavoriteView);
ParameterTypePassing
argAddFavoriteViewboolvalue

Returns: string

GetIsPanel​

The IsPanel property determines whether the IServerDocumentView object is a panel or not. A IServerDocument container stores IServerDocumentView objects and they are can be a panel view or a document view.

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.

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, IExternalForm

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.

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.

using DXP;

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

See also: IClient, IExternalForm

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.

void ReceiveNotification(INotification argNotification);
void ReceiveNotification(object argNotification);
ParameterTypePassing
argNotificationINotificationvalue

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, INotification

SetFavoritesViewState​

No description yet.

void SetFavoritesViewState(string argstate);
ParameterTypePassing
argstatestringvalue

Returns: nothing (void)

Inherited members​

Returned by​

IClient.GetServerViewFromName, IServerModule.CreateServerView, IServerModule.GetViews

Accepted by​

IClient.AddServerView, IClient.RemoveServerView, IServerModule.AddServerView, IServerModule.RemoveServerView