BlueSky.Windows.ValueLablesDialog.valLblUpBut_Click C# (CSharp) Method

valLblUpBut_Click() private method

private valLblUpBut_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        private void valLblUpBut_Click(object sender, RoutedEventArgs e)
        {
            int curindex = ValLstBox.SelectedIndex;//ValLstBox.Items.IndexOf(LabeltextBox.Text);//
            string selecteditem = getItemAtIndex(curindex);
            if (curindex > 0)
            {
                ValLstBox.Items.RemoveAt(curindex);//selected removed

                ValLstBox.Items.Insert(curindex, getItemAtIndex(curindex - 1));//shifting above item one step down
                ValLstBox.Items.RemoveAt(curindex - 1);

                ValLstBox.Items.Insert(curindex - 1, selecteditem);
                ValLstBox.SelectedIndex = curindex - 1;
                modified = true; 
            }
        }