/// <summary> /// Updates the inspector. /// </summary> public void UpdateInspector() { // Update fields with the current shape information SetColorValues(); GoBackButton.Enabled = (SelectedShape != null); // Populate the list of colors BaseColorSelector.RemoveAllItems(); BaseColorSelector.AddItem("None"); AvailableBaseColors.Clear(); var n = 0; foreach (KimonoColor color in Portfolio.Colors) { // Valid color? if (color != SelectedColor) { // Yes, add to collection BaseColorSelector.AddItem(color.Name); AvailableBaseColors.Add(color); ++n; // Currently selected color? if (SelectedColor.BaseColor?.Name == color.Name) { // Yes, highlight it BaseColorSelector.SelectItem(n); } } } }
void ReleaseDesignerOutlets() { if (GoBackButton != null) { GoBackButton.Dispose(); GoBackButton = null; } if (AdjustBrightnessCheckbox != null) { AdjustBrightnessCheckbox.Dispose(); AdjustBrightnessCheckbox = null; } if (AdjustHueCheckbox != null) { AdjustHueCheckbox.Dispose(); AdjustHueCheckbox = null; } if (AdjustOpacityCheckbox != null) { AdjustOpacityCheckbox.Dispose(); AdjustOpacityCheckbox = null; } if (AdjustSaturationCheckbox != null) { AdjustSaturationCheckbox.Dispose(); AdjustSaturationCheckbox = null; } if (BaseColorSelector != null) { BaseColorSelector.Dispose(); BaseColorSelector = null; } if (BrightnessSlider != null) { BrightnessSlider.Dispose(); BrightnessSlider = null; } if (BrightnessValue != null) { BrightnessValue.Dispose(); BrightnessValue = null; } if (Color != null) { Color.Dispose(); Color = null; } if (ColorName != null) { ColorName.Dispose(); ColorName = null; } if (HueSlider != null) { HueSlider.Dispose(); HueSlider = null; } if (HueValue != null) { HueValue.Dispose(); HueValue = null; } if (OpacitySlider != null) { OpacitySlider.Dispose(); OpacitySlider = null; } if (OpacityValue != null) { OpacityValue.Dispose(); OpacityValue = null; } if (SaturationSlider != null) { SaturationSlider.Dispose(); SaturationSlider = null; } if (SaturationValue != null) { SaturationValue.Dispose(); SaturationValue = null; } }