using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Para;
using ParaInt = Para.Para<int>;
using ParaDouble = Para.Para<double>;
using ParaString = Para.Para<string>;

namespace Pary
{    
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();            
        }        
        
        private void button1_Click(object sender, EventArgs e)
        {                                    
            Random r=new Random();            

            //int
            Para<int>[] pi=new Para<int>[10];
            for (int i = 0; i < pi.Length; i++)            
                pi[i]=new Para<int>(r.Next(10),r.Next(10));            
            string si = "";
            foreach (Para<int> para in pi) si += para.ToString() + "\n";
            MessageBox.Show("Para<int>\n" + si);
            Array.Sort(pi);
            si = "";
            foreach (Para<int> para in pi) si += para.ToString() + "\n";
            MessageBox.Show("Para<int> po sortowaniu\n" + si);            

            //double            
            Para<double>[] pd=new Para<double>[10];
            for (int i = 0; i < pi.Length; i++)
                pd[i] = new Para<double>(r.NextDouble(), r.NextDouble());                        
            string sd = "";
            foreach (Para<double> para in pd) sd += para.ToString() + "\n";
            MessageBox.Show("Para<double>\n" + sd);
            Array.Sort(pd);
            sd = "";
            foreach (Para<double> para in pd) sd += para.ToString() + "\n";
            MessageBox.Show("Para<double> po sortowaniu\n" + sd);

            //string            
            Para<string>[] ps = new Para<string>[12];
            ps[0] = new Para<string>("Śliwa", "Magdalena");
            ps[1] = new Para<string>("Liktoras", "Maria");
            ps[2] = new Para<string>("Rosner", "Milena");
            ps[3] = new Para<string>("Zenik", "Mariola");
            ps[4] = new Para<string>("Pycia", "Sylwia"); 
            ps[5] = new Para<string>("Świeniewicz", "Dorota");
            ps[6] = new Para<string>("Skowrońska", "Katarzyna");
            ps[7] = new Para<string>("Glinka", "Małgorzata");
            ps[8] = new Para<string>("Mróz", "Agata");
            ps[9] = new Para<string>("Mirek", "Joanna");
            ps[10] = new Para<string>("Przybysz", "Aleksandra");
            ps[11] = new Para<string>("Bełcik", "Izabela");
            string ss = "";
            foreach (Para<string> para in ps) ss += para.ToString() + "\n";
            MessageBox.Show("Para<string>\n" + ss);
            Array.Sort(ps);
            ss = "";
            foreach (Para<string> para in ps) ss += para.ToString() + "\n";
            MessageBox.Show("Para<string> po sortowaniu\n" + ss);
        }
    }
}
