标准 .NET 端枚举
我经常使用类似
public enum Side { Left, Top, Right, Bottom };
或 的
public enum Direction { Left, Up, Right, Down };
每次我再次描述枚举时, 枚举。 .NET 中有这种类型的标准枚举吗?
I often use enums like
public enum Side { Left, Top, Right, Bottom };
or
public enum Direction { Left, Up, Right, Down };
Every time I describe the enum again. Is there a standard enum of this kind in .NET?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不完全相同,但我知道 System.Windows.Forms.AnchorStyles 枚举。
http://msdn.microsoft.com/en-us /library/system.windows.forms.anchorstyles.aspx
否则,我会说不 - 将其添加到您自己的公共库中。由于可移植性等原因,您还必须考虑获取依赖项(即使是在 .NET Framework 上)的成本。除非您已经依赖 WinForms,否则我不会选择 WinForms。
Not quite the same, but I know of the
System.Windows.Forms.AnchorStyles
enumeration.http://msdn.microsoft.com/en-us/library/system.windows.forms.anchorstyles.aspx
Otherwise, I'd say not - add it to your own common library. You also have to consider the cost of taking dependencies (even on .NET Framework stuff), because of things like portability. I wouldn't take one on WinForms unless you are already depending on WinForms.
旧的和答案,但有一个
ArrowDirection
枚举。请参阅 https:// msdn.microsoft.com/en-us/library/system.windows.forms.arrowdirection(v=vs.110).aspx。不幸的是,它位于 System.Windows.Forms 中。Old and answered, but there is a
ArrowDirection
enum. See https://msdn.microsoft.com/en-us/library/system.windows.forms.arrowdirection(v=vs.110).aspx. Unfortunately, it is in System.Windows.Forms.