private IEnumerable <SettingBase> GetSettingBasePropertyObjects()
 {
     foreach (PropertyInfo settingBaseProperty in GetSettingBaseProperties())
     {
         SettingBase obj = (SettingBase)settingBaseProperty.GetValue(this, null);
         if (obj != null)
         {
             yield return(obj);
         }
     }
 }
 /// <summary>
 /// This method ensures that all properties is initialized.
 /// Specifically it initializes properties that is null when
 /// an object is constructed or loaded by deserializing a file.
 /// </summary>
 public virtual void EnsureInitialized()
 {
     foreach (PropertyInfo settingBaseProperty in GetSettingBaseProperties())
     {
         SettingBase settingBase = (SettingBase)settingBaseProperty.GetValue(this, null);
         if (settingBase.IsNull())
         {
             settingBase = (SettingBase)Activator.CreateInstance(settingBaseProperty.PropertyType);
             settingBaseProperty.SetValue(this, settingBase, null);
             settingBase.EnsureInitialized();
         }
         else
         {
             settingBase.EnsureInitialized();
         }
     }
 }