public object Deserialize(ObjectWithType owt)
        {
            if (owt.AssemblyQualifiedTypeName == null)
            {
                return null;
            }

            var type = Type.GetType(owt.AssemblyQualifiedTypeName);
            if (type == null)
            {
                throw new TypeLoadException();
            }

            using (var memory = new MemoryStream(owt.SerializedObject))
            {
                var value = RuntimeTypeModel.Default.Deserialize(memory, null, type);
                GraphWalker.Apply(value, this.m_LocalNode);
                return value;
            }
        }
Exemplo n.º 2
0
        public object Deserialize(ObjectWithType owt)
        {
            if (owt.AssemblyQualifiedTypeName == null)
            {
                return(null);
            }

            var type = Type.GetType(owt.AssemblyQualifiedTypeName);

            if (type == null)
            {
                throw new TypeLoadException();
            }

            using (var memory = new MemoryStream(owt.SerializedObject))
            {
                var value = RuntimeTypeModel.Default.Deserialize(memory, null, type);
                GraphWalker.Apply(value, this.m_LocalNode);
                return(value);
            }
        }