private void RefreshDisplay()
{
DockPanelGradient gradient = this.CurrentGradient;
bool enable = gradient != null;
bool docGradient = this.listBoxGradients.SelectedIndex > 3;
if (enable)
{
this.panelStartColor.BackColor = gradient.StartColor;
this.panelEndColor.BackColor = gradient.EndColor;
this.comboBoxGradient.SelectedIndex = (int)gradient.LinearGradientMode;
if (docGradient)
this.panelTextColor.BackColor = (gradient as TabGradient).TextColor;
}
this.panelStartColor.Enabled = enable;
this.panelEndColor.Enabled = enable;
this.panelTextColor.Enabled = enable && docGradient;
this.labelTextColor.ForeColor = enable && docGradient ?
SystemColors.ControlText : SystemColors.GrayText;
}