SerializeUIElements( SerializableObjectContext serializableObjectContext ) { // // Serialize each PageContent in PageContentCollection // IEnumerator enumerator = ((IEnumerable)serializableObjectContext.TargetObject).GetEnumerator(); enumerator.Reset(); UIElementCollectionSerializerContext context = new UIElementCollectionSerializerContext(this, serializableObjectContext, enumerator, SerializerAction.serializeNextUIElement); ((IXpsSerializationManagerAsync)SerializationManager).OperationStack.Push(context); }
SerializeNextUIElement( IEnumerator enumerator, SerializableObjectContext serializableObjectContext ) { if (enumerator.MoveNext()) { UIElementCollectionSerializerContext context = new UIElementCollectionSerializerContext(this, serializableObjectContext, enumerator, SerializerAction.serializeNextUIElement); ((IXpsSerializationManagerAsync)SerializationManager).OperationStack.Push(context); object uiElement = enumerator.Current; SerializeUIElement(uiElement); } }
AsyncOperation( ReachSerializerContext context ) { if (context == null) { } switch (context.Action) { case SerializerAction.endPersistObjectData: { EndPersistObjectData(); break; } case SerializerAction.serializeNextUIElement: { UIElementCollectionSerializerContext thisContext = context as UIElementCollectionSerializerContext; if (thisContext != null) { SerializeNextUIElement(thisContext.Enumerator, thisContext.ObjectContext); } break; } default: { base.AsyncOperation(context); break; } } }