惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
V
V2EX
G
Google Developers Blog
F
Full Disclosure
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
NISL@THU
NISL@THU
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
Hacker News - Newest:
Hacker News - Newest: "LLM"
A
About on SuperTechFans
The Cloudflare Blog
C
Cisco Blogs
D
DataBreaches.Net
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Vercel News
Vercel News
P
Privacy International News Feed
Microsoft Security Blog
Microsoft Security Blog
Help Net Security
Help Net Security
Recorded Future
Recorded Future
PCI Perspectives
PCI Perspectives
S
Schneier on Security
AI
AI
N
News | PayPal Newsroom
雷峰网
雷峰网
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
L
LINUX DO - 最新话题
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
Schneier on Security
Schneier on Security
S
Securelist
云风的 BLOG
云风的 BLOG
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
AWS News Blog
AWS News Blog
TaoSecurity Blog
TaoSecurity Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 三生石上(FineUI控件)
C
CXSECURITY Database RSS Feed - CXSecurity.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cloudbric
Cloudbric
C
Cybersecurity and Infrastructure Security Agency CISA
Project Zero
Project Zero
C
Check Point Blog
S
Security Affairs

博客园 - 许明会

异步编程,采用WorkgroupWorker,async和await关键字 OCR图像识别技术-Asprise OCR 关于委托,事件和类的设计准则 JavaScript能干什么? Delegate, Method as Parameter. DES对称性加密 利用委托实现异步调用 通过Windows组策略限制证书组织流氓软件的安装运行 枚举\位域\结构综合实验 - 许明会 - 博客园 public static void Invoke (Action action) C#编写WIN32系统托盘程序 C#的互操作性:缓冲区、结构、指针 SQLServer异步调用,批量复制 Python体验(10)-图形界面之计算器 Python体验(09)-图形界面之Pannel和Sizer Python体验(08)-图形界面之工具栏和状态栏 Python体验(07)-图形界面之菜单 C#利用WIN32实现按键注册 Javascript猜数字游戏
C#泛型代理、泛型接口、泛型类型、泛型方法
许明会 · 2016-04-07 · via 博客园 - 许明会
//http://www.cnblogs.com/JeffreySun/archive/2012/11/14/2770211.html
//http://www.baqima.com/a/2628.html
//http://www.cnblogs.com/yangqi/archive/2010/07/16/1778767.html
//http://www.cnblogs.com/TianFang/p/3928172.html

using System;
using System.Threading;

namespace Demo
{
    public delegate T3 MyDelegate<T1, T2, T3> (T1 t1, T2 t2);

    interface MyInteface<T1, T2, T3>
    {
        T1 DoIT (T2 t2, T3 t3);
    }


    public class MyClass<T1, T2, T3> : MyInteface<T1, T2, T3>
    {
        public T1 DoIT (T2 t2, T3 t3)
        { 
            //throw new NotImplementedException ();
            T1 t1=default(T1);
            return t1;
        }
    }

    //primary constructor
    //public class User(string name, string password){}

    public class Demo
    {
        private static readonly float KaiFaQu_WuYeFei = 18.8f;

        public static float Pay (int PeopleCount, string Family)
        {
            float result = PeopleCount * KaiFaQu_WuYeFei;
            Console.WriteLine ($"Faimily:{Family} Pay fee {result:c}");
            return result;
        }

        static void Swap<T> (ref T t1, ref T t2)
        {
            T temp = t1;
            t1 = t2;
            t2 = temp;
        }


        public static void Main ()
        {
            String str1 = "abc", str2 = "efg"; 
            Swap<String> (ref str1, ref str2);
            Console.WriteLine ($"{str1}\t{str2}");

            MyDelegate<Int32, String,float> FamXu = new MyDelegate<Int32, String,float> (Pay); 
            MyDelegate<Int32, string,float> FamLiujie = Demo.Pay;

            float MoneyXu = FamXu (4, "XU Minghui");
            float MoenyLiu = FamLiujie (3, "LiuJie");

            //
            MyClass<float,int,string> my =new MyClass<float,int,string>();
            float MoneyMu = my.DoIT (3, "Mu Jingyu");
            Console.ReadKey ();
        }
    }
}