Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ClassLibrary1;

namespace GuidaTv.Common
{
    class Sorter
    {

        public static void bubbleSort(ObservableCollection<Programs> vett)
        {


            Programs temp;

            int flag = 0; 

            do
            {
                flag = 0; //reiniziallizzo a zero il flag


                for (int i = 0; i < (vett.Count - 1); i++)
                    if (vett[i].parent.order > vett[i + 1].parent.order)
                    {
                        temp = vett[i];
                        vett[i] = vett[i + 1];
                        vett[i + 1] = temp;

                        flag = 1;
                    }
            }
            while (flag == 1);


        }
    }
}

Commits for Nextrek/Windows8/GuidaTv/GuidaTv/Common/Sorter.cs

Diff revisions: vs.
Revision Author Commited Message
21 JMBauan picture JMBauan Wed 26 Jun, 2013 10:48:36 +0000