private void UpdateContextMenu()
{
// Update visible state based of properties
_separatorTheme.Visible = _headingTheme.Visible = _colorsTheme.Visible = _visibleThemes;
_separatorStandard.Visible = _headingStandard.Visible = _colorsStandard.Visible = _visibleStandard;
_separatorRecent.Visible = _headingRecent.Visible = _colorsRecent.Visible = (_visibleRecent && (_recentColors.Count > 0));
_itemsNoColor.Visible = _visibleNoColor;
_itemsMoreColors.Visible = _visibleMoreColors;
// Define the display strings
_headingTheme.Text = Strings.ThemeColors;
_headingStandard.Text = Strings.StandardColors;
_headingRecent.Text = Strings.RecentColors;
_itemNoColor.Text = Strings.NoColor;
_itemMoreColors.Text = Strings.MoreColors;
// Define the colors used in the first two color schemes
_colorsTheme.ColorScheme = SchemeThemes;
_colorsStandard.ColorScheme = SchemeStandard;
// Define the recent colors
if (_recentColors.Count == 0)
_colorsRecent.SetCustomColors(null);
else
{
// Create an array of color arrays
Color[][] colors = new Color[_recentColors.Count][];
// Each column is just a single color
for (int i = 0; i < _recentColors.Count; i++)
colors[i] = new Color[] { _recentColors[i] };
_colorsRecent.SetCustomColors(colors);
}
// Should the no color entry be checked?
_itemNoColor.Checked = _selectedColor.Equals(Color.Empty);
}