public override InspectorPropertyInfo GetChildInfo(int childIndex)
        {
            this.EnsureUpdated();

            InspectorPropertyInfo result;

            if (!this.childInfos.TryGetValue(childIndex, out result))
            {
                result = InspectorPropertyInfo.CreateValue(
                    name: CollectionResolverUtilities.DefaultIndexToChildName(childIndex),
                    order: childIndex,
                    serializationBackend: this.Property.BaseValueEntry.SerializationBackend,
                    getterSetter: new GetterSetter <TDictionary, EditableKeyValuePair <TKey, TValue> >(
                        getter: this.CreateGetter(childIndex),
                        setter: this.CreateSetter(childIndex)),
                    attributes: this.Property.Attributes);

                this.childInfos[childIndex] = result;
            }

            return(result);
        }
Esempio n. 2
0
 public static void AddValue <TValue>(this IList <InspectorPropertyInfo> infos, string name, Func <TValue> getter, Action <TValue> setter, int order = 0, SerializationBackend backend = SerializationBackend.None, params Attribute[] attributes)
 {
     infos.Add(InspectorPropertyInfo.CreateValue(name, order, backend, new GetterSetter <object, TValue>(getter, setter), attributes));
 }