XpsSerializationManagerAsync(
            BasePackagingPolicy packagingPolicy,
            bool batchMode
            ) :
            base(packagingPolicy, batchMode)
        {
            _dispatcher = Dispatcher.CurrentDispatcher;
            _serializationOperationCanceled = false;
            this._currentPageXmlWriter      = null;
            this._isBatchWorkItemInProgress = false;

            _operationStack      = new Stack();
            _batchOperationQueue = new Queue();

            XpsDriverDocEventManager xpsDocEventManager = base.GetXpsDriverDocEventManager();

            if (xpsDocEventManager != null)
            {
                XpsSerializationCompletedInternal += new XpsSerializationCompletedEventHandler(xpsDocEventManager.ForwardSerializationCompleted);
            }
        }
Beispiel #2
0
        XpsSerializationManager(
            BasePackagingPolicy packagingPolicy,
            bool batchMode
            ) :
            base()
        {
            this._packagingPolicy = packagingPolicy;
            this._isBatchMode     = batchMode;
            this._isSimulating    = false;
            this._simulator       = null;

            _reachSerializationServices = new ReachSerializationServices();
            _visualSerializationService = new VisualSerializationService(this);

            _reachSerializationServices.RegisterNameSpacesForTypes();
            _reachSerializationServices.RegisterSerializableDependencyPropertiesForReachTypes();
            _reachSerializationServices.RegisterNoneSerializableClrPropertiesForReachTypes();

            XpsResourcePolicy resourcePolicy = new XpsResourcePolicy(XpsResourceSharing.NoResourceSharing);

            resourcePolicy.RegisterService(new XpsImageSerializationService(), typeof(XpsImageSerializationService));
            resourcePolicy.RegisterService(new XpsFontSerializationService(packagingPolicy), typeof(XpsFontSerializationService));

            this._resourcePolicy = resourcePolicy;
            _documentNumber      = 0;
            _pageNumber          = 0;
            _documentStartState  = false;
            _pageStartState      = false;

            XpsPackagingPolicy xpsPackagingPolicy = _packagingPolicy as XpsPackagingPolicy;

            if (xpsPackagingPolicy != null)
            {
                _xpsDocEventManager = new XpsDriverDocEventManager(this);

                xpsPackagingPolicy.PackagingProgressEvent += new PackagingProgressEventHandler(_xpsDocEventManager.ForwardPackagingProgressEvent);

                this.XpsSerializationPrintTicketRequiredOnXpsDriverDocEvent += new XpsSerializationPrintTicketRequiredEventHandler(_xpsDocEventManager.ForwardUserPrintTicket);
            }
        }