protected void RefreshThemes() { if (m_ThemeWindow != null) { m_ThemeWindow.Dispose(); m_ThemeWindow = new ThemeWindow(this); } if (m_ThemeRebar != null) { m_ThemeRebar.Dispose(); m_ThemeRebar = new ThemeRebar(this); } if (m_ThemeToolbar != null) { m_ThemeToolbar.Dispose(); m_ThemeToolbar = new ThemeToolbar(this); } if (m_ThemeHeader != null) { m_ThemeHeader.Dispose(); m_ThemeHeader = new ThemeHeader(this); } if (m_ThemeScrollBar != null) { m_ThemeScrollBar.Dispose(); m_ThemeScrollBar = new ThemeScrollBar(this); } if (m_ThemeProgress != null) { m_ThemeProgress.Dispose(); m_ThemeProgress = new ThemeProgress(this); } if (m_ThemeExplorerBar != null) { m_ThemeExplorerBar.Dispose(); m_ThemeExplorerBar = new ThemeExplorerBar(this); } if (m_ThemeButton != null) { m_ThemeButton.Dispose(); m_ThemeButton = new ThemeButton(this); } }
private void DisposeThemes() { if (m_ThemeWindow != null) { m_ThemeWindow.Dispose(); m_ThemeWindow = null; } if (m_ThemeRebar != null) { m_ThemeRebar.Dispose(); m_ThemeRebar = null; } if (m_ThemeToolbar != null) { m_ThemeToolbar.Dispose(); m_ThemeToolbar = null; } if (m_ThemeHeader != null) { m_ThemeHeader.Dispose(); m_ThemeHeader = null; } if (m_ThemeScrollBar != null) { m_ThemeScrollBar.Dispose(); m_ThemeScrollBar = null; } if (m_ThemeProgress != null) { m_ThemeProgress.Dispose(); m_ThemeProgress = null; } if (m_ThemeExplorerBar != null) { m_ThemeExplorerBar.Dispose(); m_ThemeExplorerBar = null; } if (m_ThemeButton != null) { m_ThemeButton.Dispose(); m_ThemeButton = null; } }
private void PaintThemeExpandButton() { if(!m_ExpandButtonVisible) return; System.Windows.Forms.Control container=this.ContainerControl as System.Windows.Forms.Control; if(!IsHandleValid(container)) return; Graphics g=BarFunctions.CreateGraphics(container); try { ThemeExplorerBar theme=null; bool bDisposeTheme=false; if(container is IThemeCache) theme=((IThemeCache)container).ThemeExplorerBar; else { bDisposeTheme=true; theme=new ThemeExplorerBar(container); } ThemeExplorerBarParts part=ThemeExplorerBarParts.NormalGroupCollapse; ThemeExplorerBarStates state=ThemeExplorerBarStates.NormalGroupCollapseNormal; Rectangle expandedRect=m_ExpandButtonRect; expandedRect.Offset(m_Rect.X,m_Rect.Y); if(m_XPSpecialGroup) { if(this.Expanded) { part=ThemeExplorerBarParts.SpecialGroupCollapse; if(m_ExpandButtonHot) state=ThemeExplorerBarStates.SpecialGroupCollapseHot; else state=ThemeExplorerBarStates.SpecialGroupCollapseNormal; } else { part=ThemeExplorerBarParts.SpecialGroupExpand; if(m_ExpandButtonHot) state=ThemeExplorerBarStates.SpecialGroupExpandHot; else state=ThemeExplorerBarStates.SpecialGroupExpandNormal; } } else { if(this.Expanded) { part=ThemeExplorerBarParts.NormalGroupCollapse; if(m_ExpandButtonHot) state=ThemeExplorerBarStates.NormalGroupCollapseHot; else state=ThemeExplorerBarStates.NormalGroupCollapseNormal; } else { part=ThemeExplorerBarParts.NormalGroupExpand; if(m_ExpandButtonHot) state=ThemeExplorerBarStates.NormalGroupExpandHot; else state=ThemeExplorerBarStates.NormalGroupExpandNormal; } } theme.DrawBackground(g,part,state,expandedRect); if(bDisposeTheme) theme.Dispose(); } finally { if (g != null) { g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault; g.Dispose(); } } }