示例#1
0
 /// <summary>
 /// Changes the drawing data based on the data type choosen
 /// </summary>
 private void lstDataSetType_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     dataType = (DataTypeSelection)lstDataSetType.SelectedIndex;
     if (!(txtConcurrency.Text).Equals(""))
     {
         concurrency = System.Convert.ToInt32(txtConcurrency.Text);
     }
     ResetFill();
     SetRectBackground();
     ResetClocks(sender, e);
 }
示例#2
0
        /// <summary>
        /// Event handler when the Sort button is clicked.
        /// 1. Sets up the state by looking at the radiobutton group.
        /// 2. Also copies state of the data type, concurrency index and the comparator size
        /// 3. Creates a delegate to process the native sort algorithm asynchnronously
        /// </summary>
        private void OnDoSortButton(object sender, RoutedEventArgs e)
        {
            ResetFill();
            SetRectBackground();
            if (rbParallelSort.IsChecked.Value == true)
            {
                sortType = SortSelection.PplParallelSort;
            }
            else if (rbParallelBufferedSort.IsChecked.Value == true)
            {
                sortType = SortSelection.PplParallelBufferedSort;
            }
            else if (rbParallelRadixSort.IsChecked.Value == true)
            {
                sortType = SortSelection.PplParallelRadixSort;
            }
            else if (rbStdSort.IsChecked.Value == true)
            {
                sortType = SortSelection.StdSort;
            }

            dataType = (DataTypeSelection)lstDataSetType.SelectedIndex;

            concurrency = System.Convert.ToInt32(txtConcurrency.Text);
            if (concurrency <= 0)
            {
                concurrency         = 1;
                txtConcurrency.Text = "1";
            }

            comparatorSize = sldComparatorSize.Value;

            done = false;

            AppDelegate sd = new AppDelegate(ExecuteSort);

            sd.BeginInvoke(null, null);
            UpdateBackground();
        }
示例#3
0
        /// <summary>
        /// Event handler when the Sort button is clicked.
        /// 1. Sets up the state by looking at the radiobutton group.
        /// 2. Also copies state of the data type, concurrency index and the comparator size
        /// 3. Creates a delegate to process the native sort algorithm asynchnronously
        /// </summary>
        private void OnDoSortButton(object sender, RoutedEventArgs e)
        {
            ResetFill();
            SetRectBackground();
            if (rbParallelSort.IsChecked.Value == true)
                sortType = SortSelection.PplParallelSort;
            else if (rbParallelBufferedSort.IsChecked.Value == true)
                sortType = SortSelection.PplParallelBufferedSort;
            else if (rbParallelRadixSort.IsChecked.Value == true)
                sortType = SortSelection.PplParallelRadixSort;
            else if (rbStdSort.IsChecked.Value == true)
                sortType = SortSelection.StdSort;

            dataType = (DataTypeSelection)lstDataSetType.SelectedIndex;

            concurrency = System.Convert.ToInt32(txtConcurrency.Text);
            if (concurrency <= 0)
            {
                concurrency = 1;
                txtConcurrency.Text = "1";
            }

            comparatorSize = sldComparatorSize.Value;

            done = false;

            AppDelegate sd = new AppDelegate(ExecuteSort);
            sd.BeginInvoke(null, null);
            UpdateBackground();
        }
示例#4
0
 /// <summary>
 /// Changes the drawing data based on the data type choosen
 /// </summary>
 private void lstDataSetType_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     dataType = (DataTypeSelection)lstDataSetType.SelectedIndex;
     if (!(txtConcurrency.Text).Equals(""))
         concurrency = System.Convert.ToInt32(txtConcurrency.Text);
     ResetFill();
     SetRectBackground();
     ResetClocks(sender, e);
 }