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
| Property | Type | Access | Description |
|---|---|---|---|
| ViewState | string | get; set |
ViewState
No description yet.
string GetViewState();
void SetViewState(string argstate);
Type: string · Access: read/write
See also: IClient, IExternalForm
Methods
| Method | Returns | Description |
|---|---|---|
| GetFavoritesViewState | string | |
| GetIsPanel | bool | The IsPanel property determines whether the IServerDocumentView object is a panel or not. |
| GetViewName | string | The ViewName property represents the view name and is not the same as the document filename. |
| ReceiveNotification | void | The ReceiveNotification method captures the notification generated by Altium Designer. |
| SetFavoritesViewState | void |
GetFavoritesViewState
No description yet.
string GetFavoritesViewState(bool argAddFavoriteView);
| Parameter | Type | Passing |
|---|---|---|
argAddFavoriteView | bool | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argNotification | INotification | 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, INotification
SetFavoritesViewState
No description yet.
void SetFavoritesViewState(string argstate);
| Parameter | Type | Passing |
|---|---|---|
argstate | string | value |
Returns: nothing (void)
Inherited members
- From IExternalForm: FocusFirstTabStop, GetBounds, GetCaption, GetHandle, Hide, ParentWindowCreated, ParentWindowDestroyed, SetBounds, SetFocus, SetParentWindow, Show
Returned by
IClient.GetServerViewFromName, IServerModule.CreateServerView, IServerModule.GetViews
Accepted by
IClient.AddServerView, IClient.RemoveServerView, IServerModule.AddServerView, IServerModule.RemoveServerView