VitNX_DockPanel.RestoreDockPanelState Method

public void RestoreDockPanelState( 
DockPanelState state
Func<string, VitNX_DockContent> getContentBySerializationKey 
)
This language is not supported or no code example is available.

Parameters

state
DockPanelState

getContentBySerializationKey
Func<string, VitNX_DockContent>

public void RestoreDockPanelState(DockPanelState state,
     Func<string, VitNX_DockContent> getContentBySerializationKey)
 {
     foreach (var region in state.Regions)
     {
         switch (region.Area)
         {
             case VitNX_DockArea.Left:
                 _regions[VitNX_DockArea.Left].Size = region.Size;
                 break;
 
             case VitNX_DockArea.Right:
                 _regions[VitNX_DockArea.Right].Size = region.Size;
                 break;
 
             case VitNX_DockArea.Bottom:
                 _regions[VitNX_DockArea.Bottom].Size = region.Size;
                 break;
         }
         foreach (var group in region.Groups)
         {
             VitNX_DockContent previousContent = null;
             VitNX_DockContent visibleContent = null;
             foreach (var contentKey in group.Contents)
             {
                 var content = getContentBySerializationKey(contentKey);
                 if (content == null)
                     continue;
                 content.DockArea = region.Area;
                 if (previousContent == null)
                     AddContent(content);
                 else
                     AddContent(content, previousContent.DockGroup);
                 previousContent = content;
                 if (group.VisibleContent == contentKey)
                     visibleContent = content;
             }
             if (visibleContent != null)
                 visibleContent.Select();
         }
     }
 }
					
This language is not supported or no code example is available.

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

.NET Core

Supported in: 5.0+, 6.0+

In this article

Definition