Esempio n. 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);
        }
Esempio n. 2
0
 public void TryALargerHat(string type, int oldSize, TryHat another)
 {
     another("I triedon a " + type + " hat at size " + (oldSize + 1).ToString());
 }
Esempio n. 3
0
        public Hats()
        {
            TryHat myHat = TryOnHat;

            TryALargerHat("Fedora", 7, myHat);
        }
Esempio n. 4
0
        public Hats()
        {
            TryHat myHat = TryOnHat;

            TryALargeHat("fadora", 7, myHat);
        }
Esempio n. 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());
 }
Esempio n. 6
0
        public Hats()                          //constructor takes no parameters
        {
            TryHat myHat = TryOnHat;           //we are assigning method to the delegate

            TryALargerHat("Fadora", 7, myHat); //method
        }
Esempio n. 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());
        }