if (!HasAttribute(it->first))
RegisterAttribute(it->first, static_cast<DynamicAttributeType>(type));
- InternalSetAttribute(it->first, data, tx, suppressEvents);
+ InternalSetAttribute(it->first, data, tx, suppressEvents, true);
}
}
}
void DynamicObject::InternalSetAttribute(const String& name, const Value& data,
- double tx, bool suppressEvent)
+ double tx, bool suppressEvent, bool allowEditConfig)
{
DynamicAttribute attr;
attr.Type = Attribute_Transient;
Value oldValue;
+ if (!allowEditConfig && (tt.first->second.Type & Attribute_Config))
+ throw_exception(runtime_error("Config properties are immutable: '" + name + "'."));
+
if (!tt.second && tx >= tt.first->second.Tx) {
oldValue = tt.first->second.Data;
tt.first->second.Data = data;
virtual void OnAttributeChanged(const String& name, const Value& oldValue);
private:
- void InternalSetAttribute(const String& name, const Value& data, double tx, bool suppressEvent = false);
+ void InternalSetAttribute(const String& name, const Value& data, double tx, bool suppressEvent = false, bool allowEditConfig = false);
Value InternalGetAttribute(const String& name) const;
AttributeMap m_Attributes;