Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Settings with Complex Types

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.

like image 583
Jeffrey Cameron Avatar asked Mar 02 '09 18:03

Jeffrey Cameron


1 Answers

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

alt text

Step 2. Browse for type

alt text

Step 3. Select type (Namespace.TypeName)

alt text

Step 4. Ta da - Done

alt text

like image 156
dance2die Avatar answered Oct 04 '22 20:10

dance2die