Fill a dictionary with properties of a class

Next the functions:

2 public functions, one to load the current configuration or to create a standard configuration is none has been found and the second one to save (write) the configuration.

Loading or Creating of the configuration File

First thing we do, we check if the configuration has been loaded alread (ConfigurationSet is false). Is it not loaded we create a new Dictionary and load all the properties without value into it (Function: PropertiesToDictionary(), we go through it in just a moment). If the configuration file exists, it will be loaded (Function: ReadConfiguration() ), if no file is found a “Standard”-configuration will be created (Function: CreateConfiguration()).

Saving / writing the Configurationfile

Writing the file and “creating” the standard configuration is the same function, saving encapsulates the “CreateConfiguration” function.

next are the private functions.

This entry was posted in C#, PC, programming, Sonstiges, Wissen, Work and tagged , , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.