示例#1
0
 private void button1_Click(object sender, EventArgs e)
 {
     Dele temp = null;
     try
     {
         switch (comboBox1.SelectedItem.ToString())
         {
             case "+": temp = new Dele(cal.Add); break;
             case "-": temp = new Dele(cal.Sub); break;
             case "*": temp = new Dele(cal.Mul); break;
             case "/": temp = new Dele(cal.Div); break;
         }
     }
     catch
     {
         MessageBox.Show("정상적으로 입력해 주세요");
     }
     if (temp != null && textBox2.Text != "0")
         temp.Invoke(int.Parse(textBox1.Text), int.Parse(textBox2.Text));
 }
示例#2
0
文件: Program.cs 项目: take91/csharp
        static void Main(string[] args)
        {
            Dele d0 = (v) => Console.WriteLine(v);

            d0.Invoke("OJC");


            Dele d1 = new Dele(d);

            d1.Invoke("OJC");


            Dele d2 = d;

            d2.Invoke("OJC");

            Dele x = (z) => Console.WriteLine(z);

            x("aaaa");
        }