private void setData(IVoxelDataExtension ext, string field, object value) { if (ext == null) { throw new InvalidOperationException(); } if (!value.Equals(getData(ext, field))) { onChange(); } data[buildKey(ext, field)] = value; }
private object getData(IVoxelDataExtension ext, string field) { if (ext == null) { throw new InvalidOperationException(); } var key = buildKey(ext, field); if (!data.ContainsKey(key)) { data[key] = ReflectionHelper.GetDefaultValue(ext.GetType().GetProperty(field).PropertyType); } return(data[key]); }
private string buildKey(IVoxelDataExtension ext, string field) { return(ext.GetType().Name + "-" + field); //return field; }