> ## Content Index
> Fetch the complete content index at: https://www.mrstebo.co.uk/llms.txt
> Use this file to discover other available public pages before exploring further.

# Extending the C# Registry-based configuration class
- URL: https://www.mrstebo.co.uk/extending-the-c-registry-based-configuration-class/
- Published: 2014-04-21T23:00:00.000Z
- Updated: 2023-05-15T23:42:36.000Z
- Author: Steven Atkinson
- Tags: C Sharp Programming, Dotnet, Programming, Software Architecture, Software Development

So we now have our `RegistryConfig` class ready... ****but how can we make it better?!**

# Use reflection!

We will use reflection to perform initialization on the classes properties, so that the settings can be added to the registry straight away. This will ensure that the registry has all the properties you have set up in your class have been initialized in the registry with the default values.

# Getting the classes properties

The method below will get a list of all the properties in your class!

We mark this as virtual so we can filter out properties we don’t want to initialize into the registry.

Here is the initialization method

This will invoke the ****getter** in each of the properties that will add the value to the registry if it doesn’t exist

The following method will be used for when we start making some sub-classes! It is just a little helper function to parse the property name.

In the next article we will make a subclass that we can use in a .NET program.