/// <summary> /// Creates a new instance of this form. /// </summary> public RampColorDialog() { InitializeComponent(); _colorRampBuilder = new RasterSymbolizer(); // Even if lblBaseColor.BackColor = Color.Gray; lblLowColor.BackColor = Color.DarkGreen; lblHighColor.BackColor = Color.Wheat; lblLowColor.Click += lblLowColor_Click; lblHighColor.Click += lblHighColor_Click; dialogButtons1.OkClicked += btnOk_Click; dialogButtons1.CancelClicked += btnCancel_Click; dialogButtons1.ApplyClicked += btnApply_Click; lblPreview.Paint += lblPreview_Paint; cddLowColor.SelectedIndexChanged += cddLowColor_SelectedIndexChanged; cddHighColor.SelectedIndexChanged += cddHighColor_SelectedIndexChanged; cddBaseColor.SelectedIndexChanged += CddBaseColorSelectedIndexChanged; lblBaseColor.Click += lblBaseColor_Click; }
/// <summary> /// Constructs a new instance and sets it up for a specific color break /// </summary> /// <param name="colorRampBuilder"></param> public RampColorDialog(IColorRampBuilder colorRampBuilder) : this() { _colorRampBuilder = colorRampBuilder; if(_colorRampBuilder.ColorBreaks == null) { _colorRampBuilder.ColorBreaks = new ColorBreakList(); } if (_colorRampBuilder.ColorBreaks.Count > 0) { lblBaseColor.BackColor = _colorRampBuilder.ColorBreaks[0].LowColor; lblLowColor.BackColor = _colorRampBuilder.ColorBreaks[0].LowColor; if (_colorRampBuilder.ColorBreaks.Count > 1) { lblHighColor.BackColor = _colorRampBuilder.ColorBreaks[_colorRampBuilder.ColorBreaks.Count - 1].HighColor; } else { lblHighColor.BackColor = lblLowColor.BackColor; } } else { lblBaseColor.BackColor = Color.Gray; lblLowColor.BackColor = Color.DarkGreen; lblHighColor.BackColor = Color.Wheat; } }