ComponentFactory.Krypton.Toolkit.ViewDrawDocker.SetDock C# (CSharp) 메소드

SetDock() 공개 메소드

Sets the dock setting for the provided child instance.
public SetDock ( ViewBase child, ViewDockStyle dock ) : void
child ViewBase Child view element.
dock ViewDockStyle DockStyle setting.
리턴 void
        public void SetDock(ViewBase child, ViewDockStyle dock)
        {
            Debug.Assert(child != null);

            // If the lookup is not already defined
            if (!_childDocking.ContainsKey(child))
            {
                // Then just add the value
                _childDocking.Add(child, dock);
            }
            else
            {
                // Overwrite the existing value
                _childDocking[child] = dock;
            }
        }

Usage Example

예제 #1
0
        /// <summary>
        /// Add a view element to a docker.
        /// </summary>
        /// <param name="i">Index of view docker.</param>
        /// <param name="dockStyle">Dock style for placement.</param>
        /// <param name="view">Actual view to add.</param>
        /// <param name="usingSpacers">Are view spacers being used.</param>
        protected override void AddViewToDocker(int i,
                                                ViewDockStyle dockStyle,
                                                ViewBase view,
                                                bool usingSpacers)
        {
            // Get the indexed docker
            ViewDrawDocker viewDocker = _viewDockers[i];

            // By default add to the end of the children
            int insertIndex = viewDocker.Count;

            // If using spacers, then insert before the first spacer
            if (usingSpacers)
            {
                for (int j = 0; j < insertIndex; j++)
                {
                    if (viewDocker[j] is ViewLayoutMetricSpacer)
                    {
                        insertIndex = j;
                        break;
                    }
                }
            }

            viewDocker.Insert(insertIndex, view);
            viewDocker.SetDock(view, dockStyle);
        }
All Usage Examples Of ComponentFactory.Krypton.Toolkit.ViewDrawDocker::SetDock