⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mathoperands.cs

📁 Microsoft?Visual C#?.NET (Core Reference)
💻 CS
字号:
using System;

namespace MSPress.CSharpCoreRef.MathDelegate
{
    public class MathOp
    {
        public delegate void OpDelegate(int First, int Second);
        public OpDelegate Op;
        
        public MathOp(int First, int Second)
        {
            _first = First;
            _second = Second;
        }

        public void Invoke()
        {
            // Explicit management of delegate invocation.
            object[] args = new object[2];
            args[0] = _first;
            args[1] = _second;

			Delegate [] operators = Op.GetInvocationList();
            foreach(Delegate d in operators)
            {
                try
                {
                    d.DynamicInvoke(args);
                }
                catch(Exception exc)
                {
                    Console.WriteLine(exc);
                }
            }
            /*
            // Default delegate invocation
            if(Op != null)
                Op(_first, _second);
            */
        }
		protected int _first;
		protected int _second;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -