private void UpdateControls() { Type = (ContourFilterCommandType)Constants.GetValueFromName( typeof(ContourFilterCommandType), (string)_cmbType.SelectedItem, _initialType); _lblMaximumError.Enabled = Type == ContourFilterCommandType.ApproxColor; _numMaximumError.Enabled = Type == ContourFilterCommandType.ApproxColor; }
private void _btnOk_Click(object sender, EventArgs e) { Threshold = (int)_numThreshold.Value; DeltaDirection = (int)_numDeltaDirection.Value; MaximumError = (int)_numMaximumError.Value; Type = (ContourFilterCommandType)Constants.GetValueFromName( typeof(ContourFilterCommandType), (string)_cmbType.SelectedItem, _initialType); _initialThreshold = Threshold; _initialDeltaDirection = DeltaDirection; _initialMaximumError = MaximumError; _initialType = Type; }
private void ContourDialog_Load(object sender, EventArgs e) { ContourFilterCommand command = new ContourFilterCommand(); _initialThreshold = command.Threshold; _initialDeltaDirection = command.DeltaDirection; _initialMaximumError = command.MaximumError; _initialType = command.Type; Threshold = _initialThreshold; DeltaDirection = _initialDeltaDirection; MaximumError = _initialMaximumError; Type = _initialType; _numThreshold.Value = Threshold; _numDeltaDirection.Value = DeltaDirection; _numMaximumError.Value = MaximumError; Tools.FillComboBoxWithEnum(_cmbType, typeof(ContourFilterCommandType), Type); UpdateControls(); }