c#-特殊的集合

位数组



可观察的集合

csharp 复制代码
 private ObservableCollection<string> strList = new ObservableCollection<string>();
    
    // Start is called before the first frame update
    void Start()
    {
        strList.CollectionChanged += Change;
        strList.Add("ssss");
        strList.Add("wwwww");
        strList.Insert(1,"eeee");
        strList.RemoveAt(1);
    }
    
    public void Change(object send,NotifyCollectionChangedEventArgs e)
    {
       Debug.Log("数组执行的操作是"+e.Action);
       if (e.OldItems != null)
       {
           foreach (var item in e.OldItems)
           {
               Debug.Log("数组删去的元素" + item);
           }
       }

       if (e.NewItems != null)
       {
           foreach (var item in e.NewItems)
           {
               Debug.Log("数组增加的元素" + item);
           }
       }
    }

不变的集合

并发集合


管道应用并发集合类


相关推荐
IT策士1 小时前
Python Word操作:从入门到精通
python·c#·word
时光追逐者2 小时前
2026 年 .NET 客户端常用 MVVM 框架推荐
c#·.net·mvvm·.net core
xiaoshuaishuai83 小时前
C# 继承与虚方法
开发语言·windows·c#
月昤昽3 小时前
C#实现AutoCAD旋转与直径标注
c#·.net·二次开发·autocad·autocad二次开发
FL16238631294 小时前
基于C#winform实现yolo26-plate中文车牌检测识别支持12种中文双层颜色车牌文字识别
开发语言·c#
Eiceblue4 小时前
锁定单元格 :C# 控制 Excel 单元格编辑权限
开发语言·c#·excel
我是唐青枫5 小时前
C#.NET YARP 详解:用 ASP.NET Core 打造高性能反向代理网关
c#·.net
火星papa14 小时前
C# 阻塞队列(BlockingCollection)
c#·queue·阻塞队列
OctShop大型商城源码19 小时前
.NET线上商城源码_C#商城源码_技术赋能下的电商新生态
开发语言·c#·.net·商城系统源码
hixiong12321 小时前
C#文件目录结构生成工具
开发语言·c#