示例#1
0
        static void Main(string[] args)
        {
            Kolekcja czekolady = new Kolekcja();

            czekolady[0] = new Marka("Wedel");
            czekolady[1] = new Marka("Milka");
            czekolady[2] = new Marka("Wawel");
            czekolady[3] = new Marka("Lint");
            czekolady[4] = new Marka("Nussbeisser");
            czekolady[5] = new Marka("Terravita");
            czekolady[6] = new Marka("Ritter");
            czekolady[7] = new Marka("Alpen Gold");
            czekolady[7] = new Marka("Deco Morreno");
            czekolady[7] = new Marka("Toblerone");

            Iterator iterator = czekolady.DodajIterator();

            Console.WriteLine("Przeszukanie Kolekcji:");

            for (Marka marka = iterator.Pierwsza();
                 !iterator.Gotowe; marka = iterator.Kolejna())
            {
                Console.WriteLine(marka.Nazwa);
            }
            Console.WriteLine();
        }
示例#2
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext  = App.ViewModel;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
            Kolekcja bla    = new Kolekcja("/cards.txt");
            Ist      ISTbla = new Ist();

            ISTbla.dodaj("baza", bla);
        }
示例#3
0
        static void Main(string[] args)
        {
            //STOS
            Console.WriteLine("STOS");
            string s1   = "Dawid";
            string s2   = "Jan";
            string s3   = "Kowalski";
            Stos   stos = new Stos();

            stos.Dodaj(s1);
            stos.Dodaj(s2);
            stos.Dodaj(s3);

            stos.Wypisz();
            Console.WriteLine("liczba elementow na stosie: " + stos.Zlicz());
            stos.Usun();
            stos.Usun();
            stos.Wypisz();
            Console.WriteLine("liczba elementow na stosie: " + stos.Zlicz());

            Console.WriteLine("KOLEKCJA Z LISTY DWUKIERUNKOWEJ");
            //KOLEKCJA Z LISTY DWUKIERUNKOWEJ
            string   k1       = "kon";
            string   k2       = "ptak";
            string   k3       = "kaczor";
            Kolekcja kolekcja = new Kolekcja();

            kolekcja.Dodaj(k1);
            kolekcja.Dodaj(k2);
            kolekcja.Dodaj(k3);
            kolekcja.Wypisz();
            Console.WriteLine();
            kolekcja.Usun(2);
            kolekcja.Usun(0);
            kolekcja.Wypisz();
            Console.WriteLine();
            kolekcja.Wstaw("Malpa", 1);
            kolekcja.Wstaw("Osa", 1);
            kolekcja.Wypisz();

            Console.ReadKey();
        }
示例#4
0
 public void Kolekcja(Kolekcja request)
 {
     throw new NotImplementedException();
 }