AddHead() public method

public AddHead ( t ) : void
return void
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            GenericList <Employee> gList = new GenericList <Employee>();

            gList.AddHead(new Employee("Julio", 1));
            gList.AddHead(new Employee("Yefry", 2));
            gList.AddHead(new Employee("Key", 3));
            gList.AddHead(new Employee("David", 4));
            gList.AddHead(new Employee("Luis", 5));

            foreach (Employee g in gList)
            {
                Console.WriteLine(g.Name + ", " + g.ID);
            }

            Employee result = gList.FindFirstOccurrence("Key");

            Console.WriteLine("Search " + result.Name + ", " + result.ID);

            GenericResponse.changeEmployeeName("Holanda", result, new Employee("K", 2));

            //this.NavigationController.NavigationBarHidden = true;

            //LoginButton.TouchUpInside += LoginButton_TouchUpInside;
        }
        static void Main(string[] args)
        {
            // int is the type argument
            GenericList <int> list = new GenericList <int>();

            for (int x = 0; x < 10; x++)
            {
                list.AddHead(x);
            }

            var index14 = list[14];

            foreach (int i in list)
            {
                System.Console.Write(i + " ");
            }

            Console.WriteLine();
            System.Console.WriteLine(list[12]);
            System.Console.WriteLine("\nDone");

            GenericList <string> lstStr = new GenericList <string>();

            lstStr.AddHead("deneme 1");
            lstStr.AddHead("deneme 2");

            var index3 = lstStr[3];

            foreach (var vrItem in lstStr)
            {
                Console.WriteLine(vrItem);
            }

            GenericList <myCustomClass> lstCustom = new GenericList <myCustomClass>();

            Console.WriteLine();
            for (int i = 0; i < 100; i++)
            {
                lstCustom.AddHead(new myCustomClass(i));
            }

            foreach (var vrPerCustom in lstCustom)
            {
                Console.Write("\t" + vrPerCustom.customProp);
            }
            Console.WriteLine();
            Console.WriteLine("special yield return");

            foreach (int i in SpecialPower(2, 8))
            {
                Console.Write("{0} ", i);
            }

            Console.ReadLine();
        }
Beispiel #3
0
            public static void Start()
            {
                GenericList <string> genericList = new GenericList <string>();

                genericList.AddHead("Hello");
                genericList.AddHead("Nein");
                foreach (string item in genericList)
                {
                    Debug.Log(item);
                }
            }
Beispiel #4
0
        /// <summary>
        /// Constraints on type parameters
        /// </summary>
        public static void ScenarioTwo()
        {
            // GenericList<Programer> list = new GenericList<Programer>(); // it's not valid
            GenericList <Dancer> list = new GenericList <Dancer>();

            list.AddHead(new Dancer("miguel", 1));
            list.AddHead(new Dancer("carlos", 2));
            list.AddHead(new Dancer("kakaroto", 3));

            Console.WriteLine(list.FindFirstOccurrence("kakaroto").ID);

            // Keep the console open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
Beispiel #5
0
    static void Main(string[] args)
    {
        GenericList <object> list = new GenericList <object>();

        // Add items to list.
        list.AddHead("some string here");
        list.AddHead(DateTime.Today.ToLongDateString());
        list.AddHead(13);
        list.AddHead(13.005);
        for (int x = 0; x < 10; x++)
        {
            list.AddHead(x);
        }
        // Enumerate list.
        foreach (object i in list)
        {
            Console.WriteLine(i + " " + i.GetType());
        }
        Console.WriteLine("\nDone");
    }
Beispiel #6
0
        static void Main1(string[] args)
        {
            GenericList <int> list = new GenericList <int>();

            for (int i = 0; i < 10; i++)
            {
                list.AddHead(i);
            }

            foreach (int i in list)
            {
                Console.WriteLine(i + "");
            }
            Console.WriteLine("\nDone");
        }
Beispiel #7
0
        public static void Main(string[] args)
        {
            GenericList <int> list = new GenericList <int> ();

            for (int x = 0; x < 10; x++)
            {
                list.AddHead(x);
            }

            foreach (int i in list)
            {
                System.Console.Write(i + " ");
            }
            System.Console.WriteLine("\nDone");
        }
    static void Main()
    {
        // int is the type argument
                GenericList<int> list = new GenericList<int>();

                for (int x = 0; x < 10; x++)
                {
                    list.AddHead(x);
                }

                foreach (int i in list)
                {
                    System.Console.Write(i + " ");
                }
                System.Console.WriteLine("\nDone");
    }
Beispiel #9
0
            static void Main()
            {
                // int is the type argument
                GenericList <int> list = new GenericList <int>();

                for (int x = 0; x < 10; x++)
                {
                    list.AddHead(x);
                }

                foreach (int i in list)
                {
                    System.Console.Write(i + " ");
                }
                System.Console.WriteLine("\nDone");
            }
Beispiel #10
0
        static void GenericListRun()
        {
            GenericList <int> list = new GenericList <int>();

            for (int x = 0; x < 10; x++)
            {
                list.AddHead(x);
            }

            foreach (int i in list)
            {
                System.Console.Write(i + " ");
            }

            System.Console.WriteLine("\nDone");
            Console.Read();
        }