当前位置: 首页>>代码示例>>C#>>正文


C# Content.ContentLeavesFloating方法代码示例

本文整理汇总了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;
        }
开发者ID:uvbs,项目名称:Holodeck,代码行数:77,代码来源:DockingManager.cs

示例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;
            }
        }
开发者ID:uvbs,项目名称:Holodeck,代码行数:73,代码来源:DockingManager.cs

示例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;
        }
开发者ID:uvbs,项目名称:Holodeck,代码行数:54,代码来源:DockingManager.cs


注:本文中的Crownwood.Magic.Docking.Content.ContentLeavesFloating方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。