public bool Load() { var value = SerializableBase.Load(GetType(), Directory, Name + ".xml") as ConfigBase; SetValue(value ?? GetDefault()); return(value != null); }
protected void SetValue(SerializableBase value) { var type = value.GetType(); foreach (var prop in type.GetProperties().Where(x => !x.CustomAttributes.Any(x => x.AttributeType == typeof(XmlIgnoreAttribute)))) { this.GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(value)); } }