From 547ed12f803bd3d04864ec38a6cde4d8bb96b6a1 Mon Sep 17 00:00:00 2001 From: zewen han Date: Tue, 28 Jun 2022 09:54:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0foreach=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E8=AF=BB=E5=86=99=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/IFoxCAD.Cad/Runtime/SymbolTable.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/IFoxCAD.Cad/Runtime/SymbolTable.cs b/src/IFoxCAD.Cad/Runtime/SymbolTable.cs index 27dd4f9..b49557d 100644 --- a/src/IFoxCAD.Cad/Runtime/SymbolTable.cs +++ b/src/IFoxCAD.Cad/Runtime/SymbolTable.cs @@ -269,7 +269,7 @@ public ObjectId GetRecordFrom(SymbolTable table, string name, b { if (table is null) { - throw new ArgumentNullException(nameof(table),"对象为null"); + throw new ArgumentNullException(nameof(table), "对象为null"); } ObjectId rid = this[name]; @@ -309,13 +309,13 @@ internal ObjectId GetRecordFrom(Func> tabl /// 集合值的类型 /// 集合 /// 要运行的委托 - public void ForEach(Action action) + public void ForEach(Action action, OpenMode openMode = OpenMode.ForRead) { //GetRecords().ForEach(re => action(re)); - + foreach (var item in this) { - var record = GetRecord(item); + var record = GetRecord(item, openMode); if (record is not null) { action(record); -- Gitee