不可变的列表

编程入门 行业动态 更新时间:2024-10-24 00:27:38
本文介绍了不可变的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

实现这一目标的最佳方法是什么,或者这是一个坏主意?

What''s the best way to achieve this, or is this a bad idea?

推荐答案

< ph ******** @ gmail写信息 新闻:11 **************** ******@h3g2000cwc.googlegro ups ... |实现这一目标的最佳方法是什么,或者这是一个坏主意? 从CollectionBase派生而不添加Add方法。超级轻松实现。实施。 我认为这不是一个坏主意。如果你有需要的话。 - Ignacio Machin machin AT laceupsolutions com Hi, <ph********@gmailwrote in message news:11**********************@h3g2000cwc.googlegro ups... | What''s the best way to achieve this, or is this a bad idea? Derive from CollectionBase and do not add a Add method. Super easy to implement. I do not think it''s a bad idea. if you have the need for it . -- Ignacio Machin machin AT laceupsolutions com

在2.0中有ReadOnlyCollection< Twhich为你做这件事。 Marc In 2.0 there is ReadOnlyCollection<Twhich does this for you. Marc

也许更好的是,从ReadOnlyCollectionBase派生而且你已经完成了。 Ignacio Machin(.NET / C#MVP)" < machin TA laceupsolutionsha scritto nel messaggio新闻:Ol **************** @ TK2MSFTNGP06.phx.gbl ... Maybe better yet, derive from ReadOnlyCollectionBase and you are quite done. "Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutionsha scritto nel messaggio news:Ol****************@TK2MSFTNGP06.phx.gbl... < ph ******** @ gmailwrote in message 新闻:11 ********************** @ h3g2000cwc.googlegro ups ... |实现这一目标的最佳方法是什么,或者这是一个坏主意? 从CollectionBase派生而不添加Add方法。超级轻松实现。实施。 我认为这不是一个坏主意。如果你有需要的话。 - Ignacio Machin machin AT laceupsolutions com Hi, <ph********@gmailwrote in message news:11**********************@h3g2000cwc.googlegro ups... | What''s the best way to achieve this, or is this a bad idea? Derive from CollectionBase and do not add a Add method. Super easy to implement. I do not think it''s a bad idea. if you have the need for it . -- Ignacio Machin machin AT laceupsolutions com

更多推荐

不可变的列表

本文发布于:2023-10-19 14:50:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1507847.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!