本文介绍了不可变的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
实现这一目标的最佳方法是什么,或者这是一个坏主意?
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
更多推荐
不可变的列表
发布评论