C# 구현된 몇 가지 위임 방법 소개

1372 단어
 
  
//
            DeleteShow ds = new DeleteShow(ShowName);
            Console.WriteLine("----------------------");
            Console.WriteLine(" ---- :");
            string Name = Console.ReadLine();
            Console.WriteLine(ds(Name));
            Console.WriteLine("----------------------");


//

            DeleteShow ds2 = delegate(string NewName) {
                return string.Format(" ---- :{0}", NewName);
            };
            Console.WriteLine("----------------------");
            Console.WriteLine(" :");
            string WriteName = Console.ReadLine();
            Console.WriteLine(ds2(WriteName));
            Console.WriteLine("----------------------");

//Lambada

            DeleteShow ds3 = (LamName) => { return string.Format("Lambada ---- :{0}", LamName); };
            Console.WriteLine("----------------------");
            Console.WriteLine(" :");
            string WriteLamName = Console.ReadLine();
            Console.WriteLine(ds3(WriteLamName));
            Console.WriteLine("----------------------");

좋은 웹페이지 즐겨찾기