标准 .NET 端枚举

发布于 2024-11-19 08:38:24 字数 217 浏览 11 评论 0原文

我经常使用类似

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帅冕 2024-11-26 08:38:24

不完全相同,但我知道 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.

成熟的代价 2024-11-26 08:38:24

旧的和答案,但有一个 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文