Exemple #1
0
        public override ControlStyleBuilderInfoList GetThemeDesignedControls(System.Windows.Forms.Control previewSurface)
        {
            RadPanelBar pane = new RadPanelBar();

            pane.GroupStyle = PanelBarStyles.OutlookNavPane;

            RadPanelBarGroupElement group  = new RadPanelBarGroupElement();
            RadPanelBarGroupElement group1 = new RadPanelBarGroupElement();
            RadPanelBarGroupElement group2 = new RadPanelBarGroupElement();
            RadPanelBarGroupElement group3 = new RadPanelBarGroupElement();

            pane.Items.Add(group);
            pane.Items.Add(group1);
            pane.Items.Add(group2);
            pane.Items.Add(group3);
            pane.Size = new Size(200, 220);

            OutlookStyle outlookStyle = pane.PanelBarElement.CurrentStyle as OutlookStyle;

            if (outlookStyle != null)
            {
                outlookStyle.ShowFewerButtons();
                outlookStyle.ShowFewerButtons();
            }

            ControlStyleBuilderInfoList controlStyleBuilderInfoList   = new ControlStyleBuilderInfoList();
            ControlStyleBuilderInfo     designControlStyleBuilderInfo = new ControlStyleBuilderInfo(pane, pane.RootElement);

            designControlStyleBuilderInfo.MainElementClassName = typeof(RadPanelBarElement).FullName;
            controlStyleBuilderInfoList.Add(designControlStyleBuilderInfo);
            return(controlStyleBuilderInfoList);
        }
Exemple #2
0
        internal void SetStyle()
        {
            RadPanelBar panelBar = null;

            if (this.ElementTree != null)
            {
                panelBar = this.ElementTree.Control as RadPanelBar;
            }


            if (this.currentStyle != null)
            {
                this.currentStyle.GetBaseLayout().ArrangeModified -= new EventHandler(RadPanelBarElement_ArrangeModified);

                currentStyle.UnWireEvents();
            }

            this.Children.Clear();

            PanelBarStyleBase style = null;

            switch (PanelBarStyle)
            {
            case PanelBarStyles.ListBar:
                style = new ListBarStyle(this);
                break;

            case PanelBarStyles.ExplorerBarStyle:
                style = new ExplorerBarStyle(this);
                break;

            case PanelBarStyles.OutlookNavPane:
                style = new OutlookStyle(this, this.contentPanel, this.itemsControl);
                break;

            case PanelBarStyles.VisualStudio2005ToolBox:
                style = new VS2005Style(this);
                break;
            }

            bool styleChanged = false;

            if (this.currentStyle != null)
            {
                styleChanged = this.currentStyle.GetType() != style.GetType();
            }

            this.currentStyle = style;

            style.CreateChildren();

            if (panelBar != null && panelBar.CanScroll)
            {
                this.Children[0].PositionOffset = SizeF.Empty;
                panelBar.vScrollBar.Value       = 0;
                panelBar.vScrollBar.Visible     = false;
                this.groupStates.Clear();
            }

            style.WireEvents();

            RadPanelBarGroupElement selectedGroup = null;

            foreach (RadPanelBarGroupElement group in this.Items)
            {
                if (group.EnableHostControlMode)
                {
                    if (group.ContentPanelSize != null)
                    {
                        group.ApplyContentSize(group.ContentPanelSize.Value);
                    }

                    group.ResetContentPanelProperties();
                    this.currentStyle.SyncHostedPanels(new RadPanelBarGroupElement[] { group }, true);
                }
                else
                {
                    this.currentStyle.SyncHostedPanels(new RadPanelBarGroupElement[] { group }, false);
                }

                if (group.Selected && this.itemsControl != null)
                {
                    selectedGroup = group;
                }
            }

            if (styleChanged)
            {
                ResetGroupsOnStyleChanged(selectedGroup);
            }

            //this.currentStyle.UpdateGroupsUI();

            this.OnLoad();

            if (this.PanelBarStyle == PanelBarStyles.ListBar || this.PanelBarStyle == PanelBarStyles.OutlookNavPane)
            {
                return;
            }

            this.currentStyle.GetBaseLayout().ArrangeModified += new EventHandler(RadPanelBarElement_ArrangeModified);
        }