本文整理汇总了C#中WeifenLuo.WinFormsUI.Docking.DockPanel.ResumeLayout方法的典型用法代码示例。如果您正苦于以下问题:C# DockPanel.ResumeLayout方法的具体用法?C# DockPanel.ResumeLayout怎么用?C# DockPanel.ResumeLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WeifenLuo.WinFormsUI.Docking.DockPanel
的用法示例。
在下文中一共展示了DockPanel.ResumeLayout方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Workbench
private Workbench()
{
// restore form location from last session
FormLocationHelper.Apply(this, "StartupFormPosition", true);
dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
dockPanel.DocumentStyle = DocumentStyle.SystemMdi;
var formOne = new FormOne();
formOne.Text = "测试1";
formOne.Dock=DockStyle.Fill;
formOne.Show(dockPanel, DockState.DockLeft);
var formTwo = new FormOne();
formTwo.Text = "测试2";
formTwo.Dock = DockStyle.Fill;
formTwo.Show(dockPanel, DockState.DockRight);
dockPanel.Dock=DockStyle.Fill;
dockPanel.ResumeLayout(true, true);
this.Controls.Add(dockPanel);
Application.Idle += OnApplicationIdle;
}
示例2: Show
public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
{
if (dockPanel == null)
throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
dockPanel.SuspendLayout(true);
DockPanel = dockPanel;
if (FloatPane == null)
{
IsHidden = true; // to reduce the screen flicker
FloatPane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, false);
FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual;
}
FloatPane.FloatWindow.Bounds = floatWindowBounds;
Show(dockPanel, DockState.Float);
Activate();
dockPanel.ResumeLayout(true, true);
}
示例3: LoadFromXml
//.........这里部分代码省略.........
// Assign Panes to DockWindows
for (int i = 0; i < dockWindows.Length; i++)
{
for (int j = 0; j < dockWindows[i].NestedPanes.Length; j++)
{
DockWindow dw = dockPanel.DockWindows[dockWindows[i].DockState];
int indexPane = dockWindows[i].NestedPanes[j].IndexPane;
DockPane pane = dockPanel.Panes[indexPane];
int indexPrevPane = dockWindows[i].NestedPanes[j].IndexPrevPane;
DockPane prevPane = (indexPrevPane == -1) ? dw.NestedPanes.GetDefaultPreviousPane(pane) : dockPanel.Panes[indexPrevPane];
DockAlignment alignment = dockWindows[i].NestedPanes[j].Alignment;
double proportion = dockWindows[i].NestedPanes[j].Proportion;
pane.DockTo(dw, prevPane, alignment, proportion);
if (panes[indexPane].DockState == dw.DockState)
panes[indexPane].ZOrderIndex = dockWindows[i].ZOrderIndex;
}
}
// Create float windows
for (int i = 0; i < floatWindows.Length; i++)
{
FloatWindow fw = null;
for (int j = 0; j < floatWindows[i].NestedPanes.Length; j++)
{
int indexPane = floatWindows[i].NestedPanes[j].IndexPane;
DockPane pane = dockPanel.Panes[indexPane];
if (j == 0)
fw = dockPanel.FloatWindowFactory.CreateFloatWindow(dockPanel, pane, floatWindows[i].Bounds);
else
{
int indexPrevPane = floatWindows[i].NestedPanes[j].IndexPrevPane;
DockPane prevPane = indexPrevPane == -1 ? null : dockPanel.Panes[indexPrevPane];
DockAlignment alignment = floatWindows[i].NestedPanes[j].Alignment;
double proportion = floatWindows[i].NestedPanes[j].Proportion;
pane.DockTo(fw, prevPane, alignment, proportion);
}
if (panes[indexPane].DockState == fw.DockState)
panes[indexPane].ZOrderIndex = floatWindows[i].ZOrderIndex;
}
}
// sort IDockContent by its Pane's ZOrder
int[] sortedContents = null;
if (contents.Length > 0)
{
sortedContents = new int[contents.Length];
for (int i = 0; i < contents.Length; i++)
sortedContents[i] = i;
int lastDocument = contents.Length;
for (int i = 0; i < contents.Length - 1; i++)
{
for (int j = i + 1; j < contents.Length; j++)
{
DockPane pane1 = dockPanel.Contents[sortedContents[i]].DockHandler.Pane;
int ZOrderIndex1 = pane1 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane1)].ZOrderIndex;
DockPane pane2 = dockPanel.Contents[sortedContents[j]].DockHandler.Pane;
int ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex;
if (ZOrderIndex1 > ZOrderIndex2)
{
int temp = sortedContents[i];
sortedContents[i] = sortedContents[j];
sortedContents[j] = temp;
}
}
}
}
// show non-document IDockContent first to avoid screen flickers
for (int i = 0; i < contents.Length; i++)
{
IDockContent content = dockPanel.Contents[sortedContents[i]];
if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState != DockState.Document)
content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
}
// after all non-document IDockContent, show document IDockContent
for (int i = 0; i < contents.Length; i++)
{
IDockContent content = dockPanel.Contents[sortedContents[i]];
if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState == DockState.Document)
content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
}
for (int i = 0; i < panes.Length; i++)
dockPanel.Panes[i].ActiveContent = panes[i].IndexActiveContent == -1 ? null : dockPanel.Contents[panes[i].IndexActiveContent];
if (dockPanelStruct.IndexActiveDocumentPane != -1)
dockPanel.Panes[dockPanelStruct.IndexActiveDocumentPane].Activate();
if (dockPanelStruct.IndexActivePane != -1)
dockPanel.Panes[dockPanelStruct.IndexActivePane].Activate();
for (int i = dockPanel.Contents.Count - 1; i >= 0; i--)
if (dockPanel.Contents[i] is DummyContent)
dockPanel.Contents[i].DockHandler.Form.Close();
dockPanel.ResumeLayout(true, true);
}
示例4: Show
public void Show(DockPanel dockPanel, DockState dockState)
{
if (dockPanel == null)
throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
if (dockState == DockState.Unknown || dockState == DockState.Hidden)
throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidDockState));
dockPanel.SuspendLayout(true);
DockPanel = dockPanel;
if (dockState == DockState.Float && FloatPane == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, true);
else if (PanelPane == null)
{
DockPane paneExisting = null;
foreach (DockPane pane in DockPanel.Panes)
if (pane.DockState == dockState)
{
paneExisting = pane;
break;
}
if (paneExisting == null)
Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
else
Pane = paneExisting;
}
DockState = dockState;
Activate();
dockPanel.ResumeLayout(true, true);
}
示例5: Initialize
// 初始化
public bool Initialize(DockPanel dockPanel)
{
// 加载配置界面
String applicationPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
String configFile = Path.Combine(Path.GetDirectoryName(applicationPath), "WorldEditor.DockPanel.config");
if (File.Exists(configFile))
{
DeserializeDockContent mDeserializeDockContent = new DeserializeDockContent(GetDockContentFromPersistString);
dockPanel.LoadFromXml(configFile, mDeserializeDockContent);
}
else
{
dockPanel.SuspendLayout(true);
this.mMainForm.Show(dockPanel, DockState.Document);
this.mWorldForm.Show(dockPanel, DockState.DockRight);
this.mSceneForm.Show(dockPanel, DockState.DockRight);
this.mEntityForm.Show(dockPanel, DockState.DockRight);
this.mTerrainForm.Show(dockPanel, DockState.DockRight);
this.mSettingForm.Show(dockPanel, DockState.DockRight);
this.mPropertyForm.Show(dockPanel, DockState.DockRight);
this.mOutputForm.Show(dockPanel, DockState.DockBottom);
dockPanel.ResumeLayout(true, true);
}
// 初始化操作接口
this.mWorldEditor = new WorldEditorFramework.MWorldEditor();
this.mWorldEditor.Initialize(this.mMainForm.Handle);
//***********
// 场景加载
this.mTerrainForm.OnSceneLoad();
this.mSettingForm.OnSceneLoad();
this.mSceneForm.OnSceneLoad();
//***********
return true;
}
示例6: Show
public void Show(DockPanel dockPanel, DockState dockState) {
if (dockPanel == null)
throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
if (dockState == DockState.Unknown || dockState == DockState.Hidden)
throw (new ArgumentException(Strings.DockContentHandler_Show_InvalidDockState));
dockPanel.SuspendLayout(true);
DockPanel = dockPanel;
DockPane paneExisting = null;
foreach (DockPane pane in DockPanel.Panes) {
if (pane.DockState != dockState) continue;
// I want BarDataRangePopup, BarScaleInterval, PositionSizePopup to open in their own floating windows
// without continue, the second popup is opened in the floating window of the first
// and window size for 2nd = size of 1st despite it was set upstack as Float.Bounds
if (pane.Contents.Contains(this.Content) == false) continue;
if (paneExisting == null || pane.IsActivated) paneExisting = pane;
if (pane.IsActivated) break;
}
if (dockState == DockState.Float) {
if (FloatPane == null) {
this.Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
} else {
// I don't understand "Activated"/Hidden" but I've found a
// deserialized restored (hidden) Pane for BarDataRangePopup, BarScaleInterval, PositionSizePopup
this.Pane = FloatPane;
//this.Pane = (paneExisting != null) ? paneExisting
// : DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
}
} else if (PanelPane == null) {
this.Pane = (paneExisting != null) ? paneExisting
: DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
}
DockState = dockState;
dockPanel.ResumeLayout(true, true); //we'll resume the layout before activating to ensure that the position
Activate(); //and size of the form are finally processed before the form is shown
}
示例7: LoadFromXml
//.........这里部分代码省略.........
if (panes[indexPane].DockState == fw.DockState)
panes[indexPane].ZOrderIndex = floatWindows[i].ZOrderIndex;
}
}
// sort IDockContent by its Pane's ZOrder
int[] sortedContents = null;
if (contents.Length > 0) {
sortedContents = new int[contents.Length];
for (int i = 0; i < contents.Length; i++)
sortedContents[i] = i;
int lastDocument = contents.Length;
for (int i = 0; i < contents.Length - 1; i++) {
int sorted_i = sortedContents[i];
for (int j = i + 1; j < contents.Length; j++) {
int sorted_j = sortedContents[j];
try {
if (sorted_i >= dockPanel.Contents.Count) {
string msg = "slow pointer went beyond the array length";
}
if (sorted_j >= dockPanel.Contents.Count) {
string msg = "fast pointer went beyond the array length";
}
if (dockPanel.Contents[sorted_j].DockHandler == null) {
string msg = "where is my handler?...";
}
DockPane pane1 = dockPanel.Contents[sorted_i].DockHandler.Pane;
int ZOrderIndex1 = pane1 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane1)].ZOrderIndex;
DockPane pane2 = dockPanel.Contents[sorted_j].DockHandler.Pane;
int ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex;
if (ZOrderIndex1 > ZOrderIndex2) {
int temp = sorted_i;
sortedContents[i] = sorted_j;
sortedContents[j] = temp;
}
} catch (Exception ex) {
continue;
}
}
}
}
// show non-document IDockContent first to avoid screen flickers
for (int i = 0; i < contents.Length; i++) {
int sorted_i = sortedContents[i];
if (sorted_i >= dockPanel.Contents.Count) {
string msg = "Huston we have a problem";
}
IDockContent content = dockPanel.Contents[sorted_i];
if (content.DockHandler.Pane != null
&& content.DockHandler.Pane.DockState != DockState.Document) {
// floating windows should not be marked IsHidden in Layout.xml...
//if they are, that will cause "ActiveContent must be one of the visible contents""
content.DockHandler.IsHidden = contents[sorted_i].IsHidden;
//content.DockHandler.IsHidden = false;
}
}
// after all non-document IDockContent, show document IDockContent
for (int i = 0; i < contents.Length; i++) {
int sorted_i = sortedContents[i];
IDockContent content = dockPanel.Contents[sorted_i];
if (content.DockHandler.Pane != null
&& content.DockHandler.Pane.DockState == DockState.Document) {
// but here I don't want to hide panes which are unserialized as hidden!!
// minimized ExceptionForm will disappear and that will make hidden: ChartForm and corresponding EditorForm
// hm it looks okay, I don't know what healed ExceptionForm...
content.DockHandler.IsHidden = contents[sorted_i].IsHidden;
//content.DockHandler.IsHidden = false;
}
}
for (int i = 0; i < panes.Length; i++) {
PaneStruct pane_i = panes[i];
DockPane destination = dockPanel.Panes[i];
int paneActiveContentIndex = pane_i.IndexActiveContent;
//try {
// destination.ActiveContent = paneActiveContentIndex == -1
// ? null : dockPanel.Contents[paneActiveContentIndex];
//} catch (Exception ex) {
// int a = 1;
//}
if (paneActiveContentIndex != -1) {
destination.ActiveContent = dockPanel.Contents[paneActiveContentIndex];
}
}
if (dockPanelStruct.IndexActiveDocumentPane != -1)
dockPanel.Panes[dockPanelStruct.IndexActiveDocumentPane].Activate();
if (dockPanelStruct.IndexActivePane != -1)
dockPanel.Panes[dockPanelStruct.IndexActivePane].Activate();
for (int i = dockPanel.Contents.Count - 1; i >= 0; i--)
if (dockPanel.Contents[i] is DummyContent)
dockPanel.Contents[i].DockHandler.Form.Close();
dockPanel.ResumeLayout(true, true);
}
示例8: RestoreDockPanel
//.........这里部分代码省略.........
// Assign Panes to DockWindows
foreach (DockWindowStruct t in dockWindows)
{
for (int j = 0; j < t.NestedPanes.Length; j++)
{
DockWindow dw = dockPanel.DockWindows[t.DockState];
int indexPane = t.NestedPanes[j].IndexPane;
DockPane pane = dockPanel.Panes[indexPane];
int indexPrevPane = t.NestedPanes[j].IndexPrevPane;
DockPane prevPane = (indexPrevPane == -1) ? dw.NestedPanes.GetDefaultPreviousPane(pane) : dockPanel.Panes[indexPrevPane];
DockAlignment alignment = t.NestedPanes[j].Alignment;
double proportion = t.NestedPanes[j].Proportion;
pane.DockTo(dw, prevPane, alignment, proportion);
if (panes[indexPane].DockState == dw.DockState)
panes[indexPane].ZOrderIndex = t.ZOrderIndex;
}
}
// Create float windows
foreach (FloatWindowStruct t in floatWindows)
{
FloatWindow fw = null;
for (int j = 0; j < t.NestedPanes.Length; j++)
{
int indexPane = t.NestedPanes[j].IndexPane;
DockPane pane = dockPanel.Panes[indexPane];
if (j == 0)
fw = dockPanel.FloatWindowFactory.CreateFloatWindow(dockPanel, pane, t.Bounds);
else
{
int indexPrevPane = t.NestedPanes[j].IndexPrevPane;
DockPane prevPane = indexPrevPane == -1 ? null : dockPanel.Panes[indexPrevPane];
DockAlignment alignment = t.NestedPanes[j].Alignment;
double proportion = t.NestedPanes[j].Proportion;
pane.DockTo(fw, prevPane, alignment, proportion);
}
if (panes[indexPane].DockState == fw.DockState)
panes[indexPane].ZOrderIndex = t.ZOrderIndex;
}
}
// sort IDockContent by its Pane's ZOrder
int[] sortedContents = null;
if (contents.Length > 0)
{
sortedContents = new int[contents.Length];
for (int i = 0; i < contents.Length; i++)
sortedContents[i] = i;
int lastDocument = contents.Length;
for (int i = 0; i < contents.Length - 1; i++)
{
for (int j = i + 1; j < contents.Length; j++)
{
DockPane pane1 = dockPanel.Contents[sortedContents[i]].DockHandler.Pane;
int ZOrderIndex1 = pane1 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane1)].ZOrderIndex;
DockPane pane2 = dockPanel.Contents[sortedContents[j]].DockHandler.Pane;
int ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex;
if (ZOrderIndex1 > ZOrderIndex2)
{
int temp = sortedContents[i];
sortedContents[i] = sortedContents[j];
sortedContents[j] = temp;
}
}
}
}
// show non-document IDockContent first to avoid screen flickers
for (int i = 0; i < contents.Length; i++)
{
IDockContent content = dockPanel.Contents[sortedContents[i]];
if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState != DockState.Document)
content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
}
// after all non-document IDockContent, show document IDockContent
for (int i = 0; i < contents.Length; i++)
{
IDockContent content = dockPanel.Contents[sortedContents[i]];
if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState == DockState.Document)
content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
}
for (int i = 0; i < panes.Length; i++)
dockPanel.Panes[i].ActiveContent = panes[i].IndexActiveContent == -1 ? null : dockPanel.Contents[panes[i].IndexActiveContent];
if (dockPanelStruct.IndexActiveDocumentPane != -1)
dockPanel.Panes[dockPanelStruct.IndexActiveDocumentPane].Activate();
if (dockPanelStruct.IndexActivePane != -1)
dockPanel.Panes[dockPanelStruct.IndexActivePane].Activate();
for (int i = dockPanel.Contents.Count - 1; i >= 0; i--)
if (dockPanel.Contents[i] is DummyContent)
dockPanel.Contents[i].DockHandler.Form.Close();
dockPanel.ResumeLayout(true, true);
}