public SettingsBag(string fileName) { FileName = fileName; foreach (var pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { if ((pi.CanRead && pi.CanWrite) == false) { continue; } PropertyData.Add(pi.Name, pi); } }