(精华)2020年6月26日 C#类库 Delegate(扩展方法)

using System;

namespace Core.Util
{
    /// 
    /// 拓展方法静态类
    /// 
    public static partial class Extention
    {
        /// 
        /// 异步,按顺序执行第一个方法和第二个方法
        /// 
        /// 第一个方法
        /// 下一个方法
        public static void Done(this Action firstFunc, Action next)
        {
            DelegateHelper.RunAsync(firstFunc, next);
        }

        /// 
        /// 异步,按顺序执行第一个方法和下一个方法
        /// 
        /// 第一个方法
        /// 下一个方法
        public static void Done(this Func<object> firstFunc, Action<object> next)
        {
            DelegateHelper.RunAsync(firstFunc, next);
        }
    }
}

你可能感兴趣的:(#,C#类库/扩展方法)