Example #1
0
        //default constructor
        public Hats()
        {
            //assinging method to delegate. Tryonhat methods assined to delegate
            //my object of the delegate
            TryHat myHat = TryOnHat;

            TryALargerHat("fadora", 7, myHat);
        }
Example #2
0
 public void TryALargerHat(string type, int oldSize, TryHat another)
 {
     another("I triedon a " + type + " hat at size " + (oldSize + 1).ToString());
 }
Example #3
0
        public Hats()
        {
            TryHat myHat = TryOnHat;

            TryALargerHat("Fedora", 7, myHat);
        }
Example #4
0
        public Hats()
        {
            TryHat myHat = TryOnHat;

            TryALargeHat("fadora", 7, myHat);
        }
Example #5
0
 public void TryALargerHat(string type, int oldSize, TryHat another) //this is a pointer to the TryHat method
 {
     another("I tried on a " + type + " hat at size " + (oldSize + 1).ToString());
 }
Example #6
0
        public Hats()                          //constructor takes no parameters
        {
            TryHat myHat = TryOnHat;           //we are assigning method to the delegate

            TryALargerHat("Fadora", 7, myHat); //method
        }
Example #7
0
        //tryon=delegate

        public void TryALargerHat(string type, int oldSize, TryHat another)
        //constructor no parameters
        {
            another("I tried on a " + type + " hat at size " + (oldSize + 1).ToString());
        }