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

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
IT之家
IT之家
腾讯CDC
博客园 - 【当耐特】
博客园 - 聂微东
月光博客
月光博客
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
博客园 - 叶小钗
S
Security @ Cisco Blogs
雷峰网
雷峰网
N
News and Events Feed by Topic
Attack and Defense Labs
Attack and Defense Labs
Forbes - Security
Forbes - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
SegmentFault 最新的问题
NISL@THU
NISL@THU
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
L
Lohrmann on Cybersecurity
Project Zero
Project Zero
www.infosecurity-magazine.com
www.infosecurity-magazine.com
宝玉的分享
宝玉的分享
阮一峰的网络日志
阮一峰的网络日志
The Last Watchdog
The Last Watchdog
Apple Machine Learning Research
Apple Machine Learning Research
W
WeLiveSecurity
C
Cisco Blogs
T
Tenable Blog
Schneier on Security
Schneier on Security
爱范儿
爱范儿
美团技术团队
V2EX - 技术
V2EX - 技术
V
V2EX
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
Security Archives - TechRepublic
Security Archives - TechRepublic
The Hacker News
The Hacker News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
博客园_首页
H
Hacker News: Front Page
量子位
N
News | PayPal Newsroom
大猫的无限游戏
大猫的无限游戏

博客园 - 山顶洞外人

k8s部署dengine-3.3.6.9 wsl 磁盘 SQL 写法对比 关于达梦8管理工具执行多行sql语法错误问题 idea 中无法连接 sql server 数据库,报错 [08S01] 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接 TransactionScope 图片扩容 已将此 订阅标记为不活动,必须将其重新初始化。需要删除NoSync 订阅,然后重新创建它们 visual studio 2017 将winform 打包成 msi 安装文件 漏洞处理 阿里云物联网测试 net core3.1 + electron 9.31.2 项目初始化 delete in 事故清表 sql 脚本执行时间 webapi filter 分组后条件查询 一行拆多行 有关数据库锁表 order by 排序的数字异常
从C#接口的属性获取多个实现类中字段的值
山顶洞外人 · 2024-02-22 · via 博客园 - 山顶洞外人
        private List<string> GetImplName()
        {
            List<string> ls = new List<string>();

            var types = AppDomain.CurrentDomain.GetAssemblies()
                        .SelectMany(a => a.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IBaseContainer))))
                        .ToArray();
            foreach (var v in types)
            {
                object ct = Activator.CreateInstance(v);
                string name = (string)v.GetProperty("Name").GetValue(ct, null);
                ls.Add($"{name}");
            }
            return ls;
        }
    public interface IBaseContainer
    {
        /// <summary>
        /// 类型名字,属性访问器,访问实现类中的_name字段
        /// </summary>
        string Name { get; }

        /// <summary>
        /// 数据保存
        /// </summary>
        void Save();
        /// <summary>
        /// 数据组合构建
        /// </summary>
        void DataBuild(SlnClass slnClass);
    }
    public class DMImpl : IBaseContainer
    {
        private string _name = "DM";

        public string Name => _name;

        public void DataBuild(SlnClass slnClass)
        {
            throw new NotImplementedException();
        }

        public void Save()
        {
            throw new NotImplementedException();
        }

    }