Example #1
0
        static void Main(string[] args)
        {
            Guarda3 <IStuff> g3i = new Guarda3 <IStuff>();
            Guarda3 <String> g3s = new Guarda3 <string>();
            Guarda3 <float>  g3f = new Guarda3 <float>();

            g3i.SetItem(3, new Food(FoodType.Bread, 2, 0.500f));
            g3s.SetItem(2, "hello");
            g3f.SetItem(1, 1.3f);

            /* Console.WriteLine(g3i.GetItem());
             * Console.WriteLine(g3s.GetItem(2, "hello"));
             * Console.WriteLine(g3f.GetItem(1, 1.3f));
             */

            foreach (String s in g3s)
            {
                Console.WriteLine(s);
            }
            foreach (IStuff i in g3i)
            {
                Console.WriteLine(i);
            }
            foreach (float f in g3f)
            {
                Console.WriteLine(f);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            Guarda <string> g3s = new Guarda3 <string>();
            Guarda <float>  g3f = new Guarda3 <float>();

            g3s SetItem(1, "Ola");
            g3s SetItem(2, "Adeus");
            g3s SetItem(3, "La La");

            g3s SetItem(1, 2.3f);
            g3s SetItem(2, 5.7f);
            g3s SetItem(3, -4);

            Console.WriteLine("g3s, GetItem(1)");
        }
Example #3
0
        static void Main(string[] args)
        {
            Guarda3 <string> g3s = new Guarda3 <string>()
            {
                "Ola", "Adeus", "LaLa"
            };
            Guarda3 <float> g3f = new Guarda3 <float>()
            {
                2.3F, 5.6F, -4F
            };

            foreach (string s in g3s)
            {
                Console.WriteLine(s);
            }

            foreach (float f in g3f)
            {
                Console.WriteLine(f);
            }
        }