Get all the properties of class in a dictionairy
using System.Reflection; class kleuren { public const string Red = "#FF0000"; public const string Green = "#00FF00"; public const string Blue = "#0000FF"; public kleuren () { } public Dictionary GetKleuren() { Dictionary mijnKleurenLijst = new Dictionary(); foreach (var item in typeof(kleuren).GetFields()) { mijnKleurenLijst.Add(item.Name, item.GetValue(item).ToString()); } return mijnKleurenLijst; } }