Esempio n. 1
0
        EndSerializeObject(
            SerializableObjectContext serializableObjectContext
            )
        {
            //
            // Pop the object from the context stack
            //
            SerializationManager.GraphContextStack.Pop();

            //
            // Recycle the used SerializableObjectContext
            //
            SerializableObjectContext.RecycleContext(serializableObjectContext);
        }
Esempio n. 2
0
        SerializeObject(
            SerializablePropertyContext serializedProperty
            )
        {
            if (serializedProperty == null)
            {
                throw new ArgumentNullException("serializedProperty");
            }

            if (SerializationManager == null)
            {
                throw new XpsSerializationException(SR.Get(SRID.ReachSerialization_MustHaveSerializationManager));
            }

            //
            // At this stage discover the graph of properties of the object that
            // need to be serialized
            //
            SerializableObjectContext serializableObjectContext = DiscoverObjectData(serializedProperty.Value,
                                                                                     serializedProperty);

            if (serializableObjectContext != null)
            {
                //
                // Push the object at hand on the context stack
                //
                SerializationManager.GraphContextStack.Push(serializableObjectContext);

                //
                // At this stage we should start streaming the markup representing the
                // object graph to the corresponding destination
                //
                PersistObjectData(serializableObjectContext);

                //
                // Pop the object from the context stack
                //
                SerializationManager.GraphContextStack.Pop();

                //
                // Recycle the used SerializableObjectContext
                //
                SerializableObjectContext.RecycleContext(serializableObjectContext);
            }
        }