Exemplo n.º 1
0
    static void Main(string[] args)
    {
        int        size  = 10;
        OvrIndexer myInd = new OvrIndexer(size);

        myInd[9]       = "Some Value";
        myInd[3]       = "Another Value";
        myInd[5]       = "Any Value";
        myInd["empty"] = "no value";
        Console.WriteLine("\nIndexer Output\n");
        for (int i = 0; i < size; i++)
        {
            Console.WriteLine("myInd[{0}]: {1}", i, myInd[i]);
        }
        Console.WriteLine("\nNumber of \"no value\" entries: {0}", myInd["no value"]);
    }
Exemplo n.º 2
0
    static void Main(string[] args)
    {
        int size = 10;
        OvrIndexer myInd = new OvrIndexer(size);

        myInd[9] = "Some Value";
        myInd[3] = "Another Value";
        myInd[5] = "Any Value";

        myInd["empty"] = "no value";

        Console.WriteLine("\nIndexer Output\n");

        for (int i=0; i < size; i++)
        {
            Console.WriteLine("myInd[{0}]: {1}", i, myInd[i]);
        }

        Console.WriteLine("\nNumber of \"no value\" entries: {0}", myInd["no value"]);
    }
        public static void Display2()
        {
            int size  = 10;
            var myInd = new OvrIndexer(size);

            myInd[9] = "Some Value";
            myInd[3] = "Another Value";
            myInd[5] = "Any Value";

            myInd["empty"] = "no value";

            for (int i = 0; i < size; i++)
            {
                Console.WriteLine("myInd[{0}]: {1}", i, myInd[i]);
            }

            Console.WriteLine("\nNumber of \"no value\" entries: {0}", myInd["no value"]);

            Console.WriteLine("\nCount of ODD massive elements: {0}", myInd[Numbers.Odd]);
            Console.WriteLine("\nCount of Even massive elements: {0}", myInd[Numbers.Even]);
        }
Exemplo n.º 4
0
    static void xMain(string[] args)
    {
        int        size  = 10;
        OvrIndexer myInd = new OvrIndexer(size);

        myInd[9] = "Some Value";
        myInd[3] = "Another Value";
        myInd[5] = "Any Value";

        myInd["empty"] = "no value";

        Console.WriteLine("\nIndexer Output\n");

        for (int i = 0; i < size; i++)
        {
            Console.WriteLine("myInd[{0}]: {1}", i, myInd[i]);
        }

        Console.WriteLine("\nNumber of \"no value\" entries: {0}", myInd["no value"]);

        // keep screen from going away
        // when run from VS.NET
        Console.ReadLine();
    }