Switch the display mode of the subeditor
To switch the display mode of the subeditor, use the SetSubEditorMode
method of the IEditorPage
object. The IEditorPage
object can be obtained using the IWorkspaceWindow.EditorPage
property. The following values can be set.
Value to set | Corresponding display mode |
---|---|
SubEditorMode.Manual | Manual |
SubEditorMode.Detail | Details |
SubEditorMode.Input | Input |
SubEditorMode.Output | Output |
SubEditorMode.SameAsMain | Same as main |
SubEditorMode.Custom | Custom *1 |
*1
When setting a custom display mode using IEditorPage.SetSubEditorMode, if there are multiple custom display modes, the first custom display mode found will be used. If you want to specify an ID and switch to a custom display mode, see here. :::
public void ShowInSubEditor(ICommandContext c, ICommandParams p)
{
IEditorPage editorPage = c.App.Window.EditorPage;
if (editorPage != null && !editorPage.IsSubEditorVisible)
{
c.App.Window.UI.ShowMessageBox("Please display the subeditor before executing.");
return;
}
//Switch to subeditor detail mode
editorPage.SetSubEditorMode(SubEditorMode.Detail);
}