コード例 #1
0
        private void DotRemoveDialog_Load(object sender, System.EventArgs e)
        {
            if (_firstTimer)
            {
                _firstTimer = false;
                DotRemoveCommand command = new DotRemoveCommand();
                _initialFlags     = command.Flags;
                _initialMinWidth  = command.MinimumDotWidth;
                _initialMinHeight = command.MinimumDotHeight;
                _initialMaxWidth  = command.MaximumDotWidth;
                _initialMaxHeight = command.MaximumDotHeight;
            }

            Flags     = _initialFlags;
            MinWidth  = _initialMinWidth;
            MinHeight = _initialMinHeight;
            MaxWidth  = _initialMaxWidth;
            MaxHeight = _initialMaxHeight;

            _cbImageUnchanged.Checked = (Flags & DotRemoveCommandFlags.ImageUnchanged) == DotRemoveCommandFlags.ImageUnchanged;
            _cbUseDiagonals.Checked   = (Flags & DotRemoveCommandFlags.UseDiagonals) == DotRemoveCommandFlags.UseDiagonals;
            _cbUseDpi.Checked         = (Flags & DotRemoveCommandFlags.UseDpi) == DotRemoveCommandFlags.UseDpi;
            _cbUseSize.Checked        = (Flags & DotRemoveCommandFlags.UseSize) == DotRemoveCommandFlags.UseSize;

            _numMinWidth.Value  = MinWidth;
            _numMinHeight.Value = MinHeight;
            _numMaxWidth.Value  = MaxWidth;
            _numMaxHeight.Value = MaxHeight;

            UpdateControls();
        }
コード例 #2
0
        private void _btnOk_Click(object sender, System.EventArgs e)
        {
            if (_numMinWidth.Value >= _numMaxWidth.Value)
            {
                Messager.ShowWarning(this, DemosGlobalization.GetResxString(GetType(), "Resx_MinWidthWarning"));
                DialogResult = DialogResult.None;
                return;
            }

            if (_numMinHeight.Value >= _numMaxHeight.Value)
            {
                Messager.ShowWarning(this, "Resx_MinHeightWarning");
                DialogResult = DialogResult.None;
                return;
            }

            Flags = DotRemoveCommandFlags.None;

            if (_cbImageUnchanged.Checked)
            {
                Flags |= DotRemoveCommandFlags.ImageUnchanged;
            }
            if (_cbUseDiagonals.Checked)
            {
                Flags |= DotRemoveCommandFlags.UseDiagonals;
            }
            if (_cbUseDpi.Checked)
            {
                Flags |= DotRemoveCommandFlags.UseDpi;
            }
            if (_cbUseSize.Checked)
            {
                Flags |= DotRemoveCommandFlags.UseSize;
            }

            MinWidth  = (int)_numMinWidth.Value;
            MinHeight = (int)_numMinHeight.Value;
            MaxWidth  = (int)_numMaxWidth.Value;
            MaxHeight = (int)_numMaxHeight.Value;

            _initialFlags     = Flags;
            _initialMinWidth  = MinWidth;
            _initialMinHeight = MinHeight;
            _initialMaxWidth  = MaxWidth;
            _initialMaxHeight = MaxHeight;
        }