public override void SetValue <TValue>(string name, TValue value) { DynamicProperty <TValue> property = GetProperty <TValue>(name); if (property != null) { property.Value = value; } }
public override void AddProperty <TValue>(string name, DynamicProperty <TValue> property) { if (HasProperty(name)) { throw new InvalidOperationException(String.Format("Can't add property {0}, because it is already added.", name)); } Properties.Add(name, property); }
// public methods... public override TValue GetValue <TValue>(string name) { DynamicProperty <TValue> property = GetProperty <TValue>(name); if (property != null) { return(property.Value); } return(default(TValue)); }
public override DynamicProperty <TValue> GetProperty <TValue>(string name) { if (!HasProperty(name)) { throw new InvalidOperationException(String.Format("Can't get property {0} value, because it doesn't exist.", name)); } DynamicProperty <TValue> property = Properties[name] as DynamicProperty <TValue>; if (property == null) { throw new InvalidOperationException(String.Format("Invalid type {0} specified for {1} property.", typeof(TValue).FullName, name)); } return(property); }
public override void AddProperty <TValue>(string name, DynamicProperty <TValue> property) { throw new InvalidOperationException("Can't add child properties to SimpleProperty instance."); }