示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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;
            }
            }
        }