Exemplo n.º 1
0
        void SearchForm_FormClosing(
            object sender,
            FormClosingEventArgs e)
        {
            if (_ok_clicked)
            {
                if (0 == cmbSearchString.Text.Length)
                {
                    e.Cancel    = true;
                    _ok_clicked = false;
                    Command.InfoMsg(
                        "Please specify a search string.");
                }

                else if (ElementType && (CurrentSelection || CurrentView))
                {
                    e.Cancel    = true;
                    _ok_clicked = false;
                    Command.InfoMsg(
                        "Element types can only be searched across the entire project, not when specifying the current selection or current view.");
                }

                _last_search_options     = SearchOptions;
                _rb_element_type_checked = ElementType;

                _rb_checked = (CurrentSelection)
          ? RadioButtonChecked.Selection
          : ((CurrentView)
            ? RadioButtonChecked.View
            : RadioButtonChecked.Project);

                _last_category = cmbCategory.Text;
                _last_location = Location;
                _last_size     = Size;
            }
        }
 private void RadioButton_OnChecked(object sender, RoutedEventArgs e)
 {
     RadioButtonChecked?.Invoke(sender, e);
 }