public Office2010ColorTable(eOffice2010ColorScheme color) { if(color == eOffice2010ColorScheme.Blue) Office2010BlueFactory.InitializeColorTable(this, ColorFactory.Empty); else if(color == eOffice2010ColorScheme.Silver) Office2010SilverFactory.InitializeColorTable(this, ColorFactory.Empty); else if (color == eOffice2010ColorScheme.Black) Office2010BlackFactory.InitializeColorTable(this, ColorFactory.Empty); else if (color == eOffice2010ColorScheme.VS2010) VisualStudio2010Factory.InitializeColorTable(this, ColorFactory.Empty); InitAppButtonColors(this, ColorFactory.Empty); _ColorScheme = color; }
public Office2010ColorTable(eOffice2010ColorScheme color, Color blendColor) { ColorFactory factory = blendColor.IsEmpty ? ColorFactory.Empty : new ColorBlendFactory(blendColor); if (color == eOffice2010ColorScheme.Blue) Office2010BlueFactory.InitializeColorTable(this, factory); else if (color == eOffice2010ColorScheme.Silver) Office2010SilverFactory.InitializeColorTable(this, factory); else if (color == eOffice2010ColorScheme.Black) Office2010BlackFactory.InitializeColorTable(this, factory); else if (color == eOffice2010ColorScheme.VS2010) VisualStudio2010Factory.InitializeColorTable(this, factory); InitAppButtonColors(this, factory); _ColorScheme = color; }
public static ElementStyle GetRibbonClientPanelStyle(ColorFactory f, eOffice2010ColorScheme cs) { ElementStyle style = new ElementStyle(); style.Class = ElementStyleClassKeys.RibbonClientPanelKey; style.BackColorGradientAngle = 90; if (cs == eOffice2010ColorScheme.Blue) { style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xC7DAF0), 0)); style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x9AB3CF), .7f)); style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x85A1C0), 1)); } else if (cs == eOffice2010ColorScheme.Silver) { style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xCDD1D6), 0)); style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xC0C4C8), .7f)); style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xBABEC2), 1)); } else if (cs == eOffice2010ColorScheme.Black) { style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x6F6F6F), 0)); style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x4F4F4F), .7f)); style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x3F3F3F), 1)); } return style; }
/// <summary> /// Generates and Changes the Office 2010 color table for all DotNetBar controls on all open forms. You can use this function for example to /// create custom color scheme based on the base color and apply it to all DotNetBar control on given form. The new color table will be applied only to controls that /// have Office 2007 and 2010 style. Any other style will be unchanged. /// </summary> /// <param name="colorTable">Base color table to use for creation of custom color table that will be applied.</param> /// <param name="baseSchemeColor">Base color used to create custom color table.</param> public static void ChangeOffice2010ColorTable(eOffice2010ColorScheme colorTable, Color baseSchemeColor) { // Make sure we use black color table in our global renderer if (GlobalManager.Renderer is Office2007Renderer) { ((Office2007Renderer)GlobalManager.Renderer).ColorTable.Dispose(); ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2010ColorTable(colorTable, baseSchemeColor); } else throw new InvalidOperationException("GlobalManager.Renderer is not Office2007Renderer. Cannot change the color table. Make sure that renderer is set to Office2007Renderer"); ApplyOffice2007ColorTable(); }