自定义枚举在C#应用程序设置类型? [英] Custom enum as application setting type in C#?

查看:131
本文介绍了自定义枚举在C#应用程序设置类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在C#中的枚举:

[Serializable]
public enum OperatingSystem 
{
    Windows,
    Macintosh
}

有关我的应用程序使用应用程序设置,在那里我可以选择哪些类型的设置应该是。我想,当我选择的浏览的,我可以选择我的枚举或键入完全合格的路径选择枚举作为类型。

For my application I use the application settings, where I can select of which Type a setting should be. I thought when I select Browse, I could choose my enum or type the fully qualified path to select that enum as the Type.

编辑:结果
我将类型设置为我的枚举,但在价值(其中于Windows,Macintosh应该是)仅适用于Windows是可见的,我能够进入任何字符串


I set the type to my Enum, but in the Value (where Windows, Macintosh should be) only Windows is visible and i'm able to enter any string.

情况:结果

Situation:

推荐答案

我看到这个VC#速成2005年浏览...选择类型对话框只显示系统和微软的命名空间。然而,如果你插入式到所选类型的文本框应该接受它的全名。

I see this in VC# Express 2005. The Browse.. "Select a Type" dialog shows only the System and Microsoft namespaces. However if you insert the full name of the type into the Selected Type textbox it should accept it.

这篇关于自定义枚举在C#应用程序设置类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆