コード例 #1
0
        private void MoveToTopButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedIndex = operationsListBox.SelectedIndex;

            if (selectedIndex > 0)
            {
                StringOperation tmp = _actions[selectedIndex];
                _actions[selectedIndex] = _actions[0];
                _actions[0]             = tmp;
                operationsListBox.Items.Refresh();
            }
        }
コード例 #2
0
        private void MoveToBottomButton_Click(object sender, RoutedEventArgs e)
        {
            var selectedIndex = operationsListBox.SelectedIndex;

            if (selectedIndex < _actions.Count - 1)
            {
                StringOperation tmp = _actions[selectedIndex];
                _actions[selectedIndex]      = _actions[_actions.Count - 1];
                _actions[_actions.Count - 1] = tmp;
                operationsListBox.Items.Refresh();
            }
        }
コード例 #3
0
        public PresetImportDialog(BindingList <StringOperation> actions)
        {
            InitializeComponent();

            _actions = new BindingList <StringOperation>(actions.Select(action => {
                StringOperation newAction = action.Clone();
                newAction.isActive        = true;
                return(newAction);
            }).ToList());

            methodsList.ItemsSource = _actions;
        }