Пример #1
0
        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            radioButton2.Checked = false;
            listBox1.Items.Clear();
            for (int i = 0; i < p.Length; i++)
            {
                for (int j = i + 1; j < p.Length; j++)
                {
                    if (p[j].MladjiOd(p[i]))
                    {
                        Primerak pom = p[i];
                        p[i] = p[j];
                        p[j] = pom;
                    }
                }
            }

            for (int i = 0; i < p.Length; i++)
            {
                if (p[i] is Knjiga)
                {
                    listBox1.Items.Add("KNJIGA: " + p[i].Info());
                }
                else if (p[i] is Casopis)
                {
                    listBox1.Items.Add("CASOPIS: " + p[i].Info());
                }
            }
        }
Пример #2
0
 public bool MladjiOd(Primerak p)
 {
     return(god > p.god);
 }
Пример #3
0
 public bool StarijiOd(Primerak p)
 {
     return(god < p.god);
 }