且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

对复杂类型使用设置

更新时间:2022-10-14 22:43:41

创建一个新的设置文件,以添加复杂/用户定义的选择类型。
这是一个枚举的操作方法。



第1步。创建设置文件





步骤2 。浏览类型



步骤3 。选择类型(Namespace.TypeName)





步骤4 。 Ta da - 完成




I am using the Settings class in my .NET project. I notice in the editor that only certain types are available to be used as types for the individual properties in the Settings class. What if I wanted to have a property that was an enumeration from my code or a generic collection for instance? How would I implement that?

I'm guessing that I can do it in a separate file using the partial class mechanism (since Settings is already defined as a partial class) but I want to see if anyone agrees with that and if there may be a way to do it within the editor.

Create a new "Settings" file to add a complex/user-defined type of choice. Here is a how-to for a Enum.

Step 1. Create a Settings file

Step 2. Browse for type

Step 3. Select type (Namespace.TypeName)

Step 4. Ta da - Done