public void Set <T>(string propertyKey, T valueOverride) { ConditionalProperty <T> property = GetProperty <T>(propertyKey); if (property != null) { property.Value = valueOverride; } }
public T Get <T>(string propertyKey, T fallbackValue) { ConditionalProperty <T> property = GetProperty <T>(propertyKey); if (property != null) { return(property.Value); } Log.LogErrorFormatted(this, "Unable to find Property ({0}), using fallback value: {1}", propertyKey, fallbackValue); return(fallbackValue); }
public ConditionalProperty <T> GetProperty <T>(string propertyKey) { if (properties.TryGetValue(propertyKey, out var value)) { ConditionalProperty <T> conditionalProperty = value as ConditionalProperty <T>; if (conditionalProperty != null) { return(conditionalProperty); } } return(null); }