Exemplo n.º 1
0
            protected override object GetValueImpl(IDataItem item)
            {
                KeyValuePair <ISlotInfo, object>[] slotValues = GenericCollectionUtils.ConvertAllToArray <
                    KeyValuePair <ISlotInfo, IDataAccessor>, KeyValuePair <ISlotInfo, object> >(slotAccessors,
                                                                                                delegate(KeyValuePair <ISlotInfo, IDataAccessor> slotAccessor)
                {
                    object value = slotAccessor.Value.GetValue(item);
                    return(new KeyValuePair <ISlotInfo, object>(slotAccessor.Key, value));
                });

                ObjectCreationSpec spec = new ObjectCreationSpec(type, slotValues, converter);

                return(spec.CreateInstance());
            }
Exemplo n.º 2
0
            protected override object GetValueImpl(IDataItem item)
            {
                KeyValuePair<ISlotInfo, object>[] slotValues = GenericCollectionUtils.ConvertAllToArray<
                    KeyValuePair<ISlotInfo, IDataAccessor>, KeyValuePair<ISlotInfo, object>>(slotAccessors,
                    delegate(KeyValuePair<ISlotInfo, IDataAccessor> slotAccessor)
                    {
                        object value = slotAccessor.Value.GetValue(item);
                        return new KeyValuePair<ISlotInfo, object>(slotAccessor.Key, value);
                    });

                ObjectCreationSpec spec = new ObjectCreationSpec(type, slotValues, converter);
                return spec.CreateInstance();
            }