Beispiel #1
0
        CanSerializeClrProperty(
            Object serializableObject,
            TypePropertyCache property,
            ReachSerializationServices reachSerializationServices
            )
        {
            bool canSerialize = true;

            if (serializableObject != null &&
                property != null &&
                property.PropertyInfo != null)
            {
                String name = property.PropertyInfo.Name;

                Hashtable clrPropertiesTable = (Hashtable)reachSerializationServices.
                                               TypeNoneSerializableClrProperties[serializableObject.GetType()];

                if (clrPropertiesTable != null)
                {
                    if (clrPropertiesTable.Contains(name))
                    {
                        canSerialize = false;
                    }
                }
            }

            return(canSerialize);
        }
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);
            }
        }
Beispiel #3
0
        CanSerializeDependencyProperty(
            Object serializableObject,
            TypeDependencyPropertyCache dependencyProperty,
            ReachSerializationServices reachSerializationServices
            )
        {
            bool canSerialize = false;

            if (serializableObject != null &&
                dependencyProperty != null &&
                ((dependencyProperty.PropertyInfo != null) ||
                 (((DependencyProperty)(dependencyProperty.DependencyProperty)).Name != null)))
            {
                String name = (dependencyProperty.PropertyInfo != null) ?
                              dependencyProperty.PropertyInfo.Name :
                              ((DependencyProperty)(dependencyProperty.DependencyProperty)).Name;

                Hashtable dependencyPropertiesTable = (Hashtable)reachSerializationServices.
                                                      TypeSerializableDependencyProperties[serializableObject.GetType()];

                if (dependencyPropertiesTable != null)
                {
                    if (dependencyPropertiesTable.Contains(name))
                    {
                        canSerialize = true;
                    }
                }
                else
                {
                    canSerialize = true;
                }
            }
            else
            {
                canSerialize = true;
            }

            return(canSerialize);
        }
Beispiel #4
0
        XpsOMSerializationManager(
            XpsOMPackagingPolicy xpsOMManager,
            bool batchMode
            ) :
            base()
        {
            _packagingPolicy = xpsOMManager;
            _isBatchMode     = batchMode;

            _reachSerializationServices = new ReachSerializationServices();
            _reachSerializationServices.RegisterNameSpacesForTypes();
            _reachSerializationServices.RegisterSerializableDependencyPropertiesForReachTypes();
            _reachSerializationServices.RegisterNoneSerializableClrPropertiesForReachTypes();
            _visualSerializationService = new VisualSerializationService(this);

            XpsResourcePolicy resourcePolicy = new XpsResourcePolicy(XpsResourceSharing.NoResourceSharing);

            resourcePolicy.RegisterService(new XpsImageSerializationService(), typeof(XpsImageSerializationService));
            resourcePolicy.RegisterService(new XpsFontSerializationService(_packagingPolicy), typeof(XpsFontSerializationService));
            _resourcePolicy = resourcePolicy;

            SetFontSubsettingPolicy(FontSubsetterCommitPolicies.CommitPerPage);
            SetFontSubsettingCountPolicy(4);
        }