/// <inheritdoc/> protected internal override KeyValuePair <object, object> CloneElement(int index) { RecordStateForUndo(); SerializableProperty keyProperty = (SerializableProperty)GetKey(index); SerializableProperty valueProperty = (SerializableProperty)GetValue(keyProperty); SerializableDictionary dictionary = property.GetDictionary(); DictionaryDataWrapper keyData = new DictionaryDataWrapper(); keyData.value = SerializableUtility.Clone(keyProperty.GetValue <object>()); SerializableProperty clonedKeyProperty = new SerializableProperty(dictionary.KeyPropertyType, dictionary.KeyType, () => keyData.value, (x) => keyData.value = x); DictionaryDataWrapper valueData = new DictionaryDataWrapper(); valueData.value = SerializableUtility.Clone(valueProperty.GetValue <object>()); SerializableProperty clonedValueProperty = new SerializableProperty(dictionary.ValuePropertyType, dictionary.ValueType, () => valueData.value, (x) => valueData.value = x); return(new KeyValuePair <object, object>(clonedKeyProperty, clonedValueProperty)); }
/// <inheritdoc/> protected internal override object CreateValue() { SerializableDictionary dictionary = property.GetDictionary(); DictionaryDataWrapper data = new DictionaryDataWrapper(); data.value = SerializableUtility.Create(dictionary.ValueType); SerializableProperty valueProperty = new SerializableProperty(dictionary.ValuePropertyType, dictionary.ValueType, () => data.value, (x) => data.value = x); return(valueProperty); }
/// <inheritdoc/> protected internal override object CreateValue() { SerializableDictionary dictionary = property.GetDictionary(); DictionaryDataWrapper data = new DictionaryDataWrapper(); data.value = SerializableUtility.Create(dictionary.ValueType); SerializableProperty valueProperty = new SerializableProperty(dictionary.ValuePropertyType, dictionary.ValueType, () => data.value, (x) => data.value = x); return valueProperty; }
/// <inheritdoc/> protected internal override KeyValuePair<object, object> CloneElement(int index) { SerializableProperty keyProperty = (SerializableProperty)GetKey(index); SerializableProperty valueProperty = (SerializableProperty)GetValue(keyProperty); SerializableDictionary dictionary = property.GetDictionary(); DictionaryDataWrapper keyData = new DictionaryDataWrapper(); keyData.value = SerializableUtility.Clone(keyProperty.GetValue<object>()); SerializableProperty clonedKeyProperty = new SerializableProperty(dictionary.KeyPropertyType, dictionary.KeyType, () => keyData.value, (x) => keyData.value = x); DictionaryDataWrapper valueData = new DictionaryDataWrapper(); valueData.value = SerializableUtility.Clone(valueProperty.GetValue<object>()); SerializableProperty clonedValueProperty = new SerializableProperty(dictionary.ValuePropertyType, dictionary.ValueType, () => valueData.value, (x) => valueData.value = x); return new KeyValuePair<object,object>(clonedKeyProperty, clonedValueProperty); }