Пример #1
0
 private void UpdateControls()
 {
     Type = (ContourFilterCommandType)Constants.GetValueFromName(
         typeof(ContourFilterCommandType),
         (string)_cmbType.SelectedItem,
         _initialType);
     _lblMaximumError.Enabled = Type == ContourFilterCommandType.ApproxColor;
     _numMaximumError.Enabled = Type == ContourFilterCommandType.ApproxColor;
 }
Пример #2
0
        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;
        }
Пример #3
0
        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();
        }