pascal里面的集合(set)在C#里面如何表达?

wave_calmly 2002-09-12 12:35:42
例如这段代码:
TGridOption = (goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine,
goRangeSelect, goDrawFocusSelected, goRowSizing, goColSizing, goRowMoving,
goColMoving, goEditing, goTabs, goRowSelect,
goAlwaysShowEditor, goThumbTracking);
TGridOptions = set of TGridOption;
在C#里面怎么表达?
因为在Delphi里面,控件的属性为集合,则IDE设计器自动为它提供一个属性编辑器。用C#写控件,怎么实现这种效果?
...全文
103 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
saucer 2002-09-12
  • 打赏
  • 举报
回复
Correct me if I am wrong, but I believe there are no set classes in C#, you can use enum type in C# to represent your values, and use one of those classes under System.Collections to simulate the concept of "set"

But take a look at this

Generic C# Sample Programs
http://www.dina.dk/~sestoft/gcsharp/

the generics is coming! :-)
TheAres 2002-09-12
  • 打赏
  • 举报
回复
Yes, Saucer provides a good way for this issue. And I'd like say, there is the Set in C#. Search the "interface IEnumerable" and "interface ICollection" from the help of the Visual Studio .Net, you can get what you want.

ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfsystemcollectionsienumerableclasstopic.htm
ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfSystemCollectionsICollectionMembersTopic.htm

I think I don't need to say more, If not, please let me know.
------------------------
I like to teach a fish how to swim.

110,531

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧