Example #1
0
        static void Main(string[] args) {
            string[] data = { "This", "is", "annoying" };
            data.PrintDataAndBeep();

            Console.WriteLine();

            List<int> myInts = new List<int>() { 10, 15, 20 };
            myInts.PrintDataAndBeep();

            Console.ReadLine();
        }
Example #2
0
 public static void TextAnnoyingExtensions()
 {
     Console.WriteLine("Extending interface compatible types");
     string[] data = {"Wow", "this", "is", "sort", "of", "annoying",
                      "but", "in", "a", "weird", "way", "fun"};
     data.PrintDataAndBeep();
     Console.WriteLine();
     // List<t> implements IEnumerable!
     List<int> myInts = new List<int>() {10, 15, 20};
     myInts.PrintDataAndBeep();
 }
        static void Main(string[] args)
        {
            Console.WriteLine("***** Extending Interface Compatible Types *****\n");

            // System.Array implemnets IEnumerable!
            string[] data = {"Wow", "this", "is", "sort", "of", "annoying",
                            "but", "in", "a", "wierd", "way", "fun!"};
            data.PrintDataAndBeep();

            Console.WriteLine();

            // List<T> implements IEnumerable!
            List<int> myInts = new List<int>() { 10, 15, 20 };
            myInts.PrintDataAndBeep();

            Console.ReadLine();
        }