コード例 #1
0
        private static void EventSample()
        {
            Coats  myCoat = new Coats();
            string result = myCoat.myResult;

            Console.WriteLine(result);
        }
コード例 #2
0
        // Advanced C Sharp Implementation
        private static void EventSample()
        {
            Coats  myCoat = new Coats();     //Instatiate the class
            string result = myCoat.MyResult; // Get result from property

            Console.WriteLine(result);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: fezstir/myfirstapp
        private static void EventSample()
        {
            Coats  myCoats = new Coats();
            string result  = myCoats.MyResult;

            Console.WriteLine("My FavoriteCoats is ");
        }
コード例 #4
0
        public delegate void TryOn(string Type);  //won't work in main

        public static void RunWeek4Classwork()
        {
            DelegateSample();

            EventSample();

            LambdaSample();

            void LambdaSample()
            {
                LambdaExamples myLamb = new LambdaExamples();

                //myLamb.MyLambdaOne(5);
                Console.WriteLine(myLamb.MyLambdaOne(5));


                LambdaExamples mySecond = new LambdaExamples(23);

                Console.WriteLine(mySecond.MyLambdaOne(mySecond.MyValue));
            }

            void DelegateSample()
            {
                Hats  myHat  = new Hats("Cowboy", 7); //old stuff
                TryOn theHat = myHat.TryOnHat;

                theHat("I tried on a " + myHat.HatType + " hat was size " + myHat.HatSize);

                Hats mySecond = new Hats();
            }

            void EventSample()
            {
                Coats  myCoat = new Coats();      //Instantiate the class
                string result = myCoat.MyResult;  //Get results from the property

                Console.WriteLine(result);
            }
        }
コード例 #5
0
 public getAllResponse(Coats.Crafts.FASWebService.page page)
 {
     this.page = page;
 }