예제 #1
0
        public void ProcessGeneric <T>(IWriteOnlyValueDescriptor <T> descriptor)
        {
            XElement temp = _reader;

            _reader = _reader.Element(descriptor.StateMember.Name);

            CreateObject(descriptor);

            descriptor.Climb();

            _reader = temp;
        }
        public void Process <T>(IWriteOnlyValueDescriptor <T> descriptor)
        {
            string type;

            if (_store.TryGet("Type", out type))
            {
                var value = (T)Activator.CreateInstance(Type.GetType(type));

                descriptor.Set(value);

                var temp = _store;
                _store = _store.GetInner(descriptor.StateMember.Name);

                descriptor.Climb();

                _store = temp;
            }
        }