I suppose you could binary serialize it, but I don't really see a problem with how you're doing it.
If you have multiple preferences, creating a serializable Preference class would probably be better. You could either binary serialize it and store in the registry or on disk, or XML serialize it to a config file. Or you could implement a custom "registry serializer" that would store it as meaningful names in the registry.
Other than that, I don't really see a problem with how you're doing it....
|