protected void Reset() { IDynamicProperty <T> tmp = null; foreach (var propertyName in _fallbackProperties) { tmp = _propertiesManager.GetProperty <T>(propertyName); if (tmp != null) { break; } } Interlocked.Exchange(ref _activeProperty, tmp); }
public IDynamicProperty <T> AsProperty <T>(T value, string name = null) { if (name != null && _properties.GetProperty <T>(name) != null) { throw new ArgumentException("Duplicate property name"); } var p = new DynamicProperty <T>(_properties, name); if (!String.IsNullOrEmpty(name)) { Add(name, p); } p.Set(value); return(p); }