本文整理汇总了C#中Crownwood.Magic.Docking.Content.ContentLeavesFloating方法的典型用法代码示例。如果您正苦于以下问题:C# Content.ContentLeavesFloating方法的具体用法?C# Content.ContentLeavesFloating怎么用?C# Content.ContentLeavesFloating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crownwood.Magic.Docking.Content
的用法示例。
在下文中一共展示了Content.ContentLeavesFloating方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddContentWithState
public WindowContent AddContentWithState(Content c, State newState)
{
// Validate the incoming Content instance is a valid reference
// and is a current instance within our internal collection
if ((c == null) || !_contents.Contains(c))
return null;
// Do not generate hiding/hidden/shown events
_surpressVisibleEvents++;
// Manageing Zones should remove display AutoHide windows
RemoveShowingAutoHideWindows();
// Is the window already part of a WindowContent?
if (c.ParentWindowContent != null)
{
// If it used to be in a floating mode, then record state change
if (c.ParentWindowContent.ParentZone.State == State.Floating)
c.ContentLeavesFloating();
// Remove the Content from its current WindowContent
c.ParentWindowContent.Contents.Remove(c);
}
// Create a new Window instance appropriate for hosting a Content object
Window w = CreateWindowForContent(c);
ContainerControl destination = null;
if (newState != State.Floating)
{
destination = _container;
destination.SuspendLayout();
}
// Create a new Zone capable of hosting a WindowContent
Zone z = CreateZoneForContent(newState, destination);
if (newState == State.Floating)
{
// Content is not in the docked state
c.Docked = false;
// destination a new floating form
destination = new FloatingForm(this, z, new ContextHandler(OnShowContextMenu));
// Define its location
destination.Location = c.DisplayLocation;
// ...and its size, add the height of the caption bar to the requested content size
destination.Size = new Size(c.FloatingSize.Width,
c.FloatingSize.Height + SystemInformation.ToolWindowCaptionHeight);
}
// Add the Window to the Zone
z.Windows.Add(w);
if (newState != State.Floating)
{
// Set the Zone to be the least important of our Zones
ReorderZoneToInnerMost(z);
UpdateInsideFill();
destination.ResumeLayout();
}
else
destination.Show();
// Enable generation hiding/hidden/shown events
_surpressVisibleEvents--;
// Generate event to indicate content is now visible
OnContentShown(c);
return w as WindowContent;
}
示例2: InsertContentIntoWindowContent
public WindowContent InsertContentIntoWindowContent(int pos, Content c, WindowContent wc)
{
// Validate the incoming Content instance is a valid reference
// and is a current instance within our internal collection
if ((c == null) || !_contents.Contains(c))
return null;
// Validate the incoming WindowContent instance is a valid reference
if (wc == null)
return null;
// Is Content already part of given Window then nothing to do
if (c.ParentWindowContent == wc)
return wc;
else
{
bool valid = true;
// Do not generate hiding/hidden/shown events
_surpressVisibleEvents++;
// Manageing Zones should remove display AutoHide windows
RemoveShowingAutoHideWindows();
if (c.ParentWindowContent != null)
{
// Is there a change in docking state?
if (c.ParentWindowContent.ParentZone.State != wc.ParentZone.State)
{
// If it used to be in a floating mode, then record state change
if (c.ParentWindowContent.ParentZone.State == State.Floating)
c.ContentLeavesFloating();
else
c.ContentBecomesFloating();
}
// Remove the Content from its current WindowContent
c.ParentWindowContent.Contents.Remove(c);
}
else
{
// If a window content is in AutoHide then it will not have a parent zone
if (wc.ParentZone != null)
{
// If adding to a floating window then it is not docked
if (wc.ParentZone.State == State.Floating)
c.Docked = false;
}
else
{
// Cannot dynamically add into an autohide parent
valid = false;
}
}
if (valid)
{
// Add the existing Content to this instance
wc.Contents.Insert(pos, c);
}
// Enable generation hiding/hidden/shown events
_surpressVisibleEvents--;
if (valid)
{
// Generate event to indicate content is now visible
OnContentShown(c);
}
return wc;
}
}
示例3: AddContentToZone
public Window AddContentToZone(Content c, Zone z, int index)
{
// Validate the incoming Content instance is a valid reference
// and is a current instance within our internal collection
if ((c == null) || !_contents.Contains(c))
return null;
// Validate the incoming Zone instance is a valid reference
if (z == null)
return null;
// Do not generate hiding/hidden/shown events
_surpressVisibleEvents++;
// Manageing Zones should remove display AutoHide windows
RemoveShowingAutoHideWindows();
// Is the window already part of a WindowContent?
if (c.ParentWindowContent != null)
{
// Is there a change in docking state?
if (c.ParentWindowContent.ParentZone.State != z.State)
{
// If it used to be in a floating mode, then record state change
if (c.ParentWindowContent.ParentZone.State == State.Floating)
c.ContentLeavesFloating();
else
c.ContentBecomesFloating();
}
// Remove the Content from its current WindowContent
c.ParentWindowContent.Contents.Remove(c);
}
else
{
// If target zone is floating window then we are no longer docked
if (z.State == State.Floating)
c.Docked = false;
}
// Create a new WindowContent instance according to our style
Window w = CreateWindowForContent(c);
// Add the Window to the Zone at given position
z.Windows.Insert(index, w);
// Enable generation hiding/hidden/shown events
_surpressVisibleEvents--;
// Generate event to indicate content is now visible
OnContentShown(c);
return w;
}