CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Sort
C#
private void listUp(CheckedListBox listBox)
{
    if (listBox.SelectedIndex == -1 || listBox.SelectedIndex == 0)
        return;
 
    object selected;
    object previous;
    object temp;
    
    bool selectedChecked;
by cjb110   March 31, 2012 @ 4:13am
21 Views
no comments
 
C#
List<Product> products = new List<Product>();
 
products.Sort(delegate(Product p1, Product p2)
{
return p1.ProductName.CompareTo(p2.ProductName);
});
by jaredmroberts   October 21, 2011 @ 8:49am
Tags: List<>, Sort
75 Views
no comments
 
public class SortByName implements Sortable {
    
    @Override
    public File[] sort(File[] files) {
        File aux;
        
        for (int i = files.length; i >= 1; i--) {
            for (int j = 1; j < i; j++) {
                if (files[j] != null && 
                        files[j - 1].getName().compareTo(files[j].getName()) > 0) {
by Licínio Mendes   May 31, 2011 @ 6:32am
101 Views
no comments
 
C#
namespace WindowsFormsApplication1
{
    public partial class Form1 : System.Windows.Forms.Form
    {
        public Form1()
        {
            InitializeComponent();
 
            // create list of data
            var _List = new System.Collections.Generic.List<Data> 
by Jerry Nixon   January 24, 2011 @ 2:17pm
1721 Views
1 comments
 
C#
public IList MergeSort(IList list)
{
    if (list.Count <= 1)
        return list;
 
    int mid = list.Count / 2;
 
    IList left = new ArrayList();
    IList right = new ArrayList();
by Robert.Eberhart   December 20, 2010 @ 10:30am
317 Views
no comments
 
C#
private LinkedList<Element>MergeSort(LinkedList<Element> linkedList, string sortType) {
    if (linkedList.Count <= 1){
        return linkedList;
    }
 
    LinkedList<Element> left, right, result;
 
    int middle = linkedList.Count / 2;
 
    left = ReturnLinkedListSegment(0, middle, linkedList);
by Robert.Eberhart   December 20, 2010 @ 6:53am
181 Views
no comments
 
C#
public class GenericComparer<T> : IComparer<T>
{
    public List<Tuple<string, bool>> Comparisons { get; set; }
 
    public int Compare(T x, T y)
    {
        int returnValue = 0;
        IComparable xval;
        IComparable yval;
        
by JamesEggers   April 28, 2010 @ 8:30am
Tags: C#, Sorting
210 Views
no comments
 
Lparameters toColumn
 
Local laControlSource[1], lcAlias, lcControlSource, lcControlSourceTest, lcField, lcPicture
Local lcSortDirection, lnSelect, loHeader
 
Dimension laControlSource[1]
 
 If Type('toColumn.sorting_header') <> 'O'
    Return
 Endif
by Matt Slay   January 28, 2010 @ 1:07pm
738 Views
no comments
 
C++
/* --------------------------------- */
// sortari.h
#include <iostream>
#include <time.h>
 
using namespace std;
 
// Sortare prin selectie, nu prea imi place :D
// O(n^2)
void selectie(int sir[], int el);
by Parvulescu Cosmin   December 02, 2009 @ 4:54pm
217 Views
no comments
 
C#
/// <summary>
        /// Sorts the list box in descending order
        /// </summary>
        /// <param name="pList">the list to sort</param>
        /// <param name="pByValue">Sort the list by values or text</param> 
        private void SortListBox(ref ListBox pList, bool pByValue)
        {
            var lListItems = new System.Collections.SortedList();
 
            //add listbox items to SortedList 
by Abhilash   November 13, 2009 @ 4:03am
1860 Views
no comments
 
C#
/// <summary>
/// Sorts the dropdownlist in descending order
/// </summary>
/// <param name="objDDL"></param>
private void SortDropDownList(ref DropDownList objDDL)
{
    var textList = new ArrayList();
    var valueList = new ArrayList();
 
    foreach (ListItem li in objDDL.Items)
by Abhilash   November 13, 2009 @ 4:03am
494 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate