public bool TryGetProperty <T>(string key, out T value) { if (IntegerProperties.TryGetValue(key, out var val)) { value = (T)Convert.ChangeType(val, typeof(T)); return(true); } if (StringProperties.TryGetValue(key, out var stringVal)) { value = (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFrom(stringVal); return(true); } value = default; return(false); }
public bool TryGetProperty(string key, out string value) { return(StringProperties.TryGetValue(key, out value)); }