public object GetInitialValue(string name) { foreach (var prop in InitialValues.GetType().GetProperties()) { if (prop.CanRead && prop.Name == name) { return(prop.GetValue(InitialValues, null)); } } return(null); }
public void InitializeValues() { foreach (var prop in InitialValues.GetType().GetProperties()) { foreach (var customprop in Settings.GetAllProperties()) { if (customprop.Name.ToUpper() == prop.Name.ToUpper()) { //customprop.Value = prop.GetValue(InitialValues, null); customprop.Value = Conversions.ToString(prop.GetValue(RuntimeHelpers.GetObjectValue(this.InitialValues), null)); } } } }