ComponentFactory.Krypton.Toolkit.ButtonSpecManagerLayout.AddViewToDocker C# (CSharp) Method

AddViewToDocker() protected method

Add a view element to a docker.
protected AddViewToDocker ( int i, ViewDockStyle dockStyle, ViewBase view, bool usingSpacers ) : void
i int Index of view docker.
dockStyle ViewDockStyle Dock style for placement.
view ViewBase Actual view to add.
usingSpacers bool Are view spacers being used.
return void
        protected override void AddViewToDocker(int i,
                                                ViewDockStyle dockStyle,
                                                ViewBase view,
                                                bool usingSpacers)
        {
            // Get the indexed docker
            ViewLayoutDocker 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);
        }