/// <summary>
        /// constructor
        /// </summary>
        /// <param name="myEnvironment">environment</param>
        /// <remarks>this should only be used by the DataSpaceManager class</remarks>
        public CompressionTransform(TransformEnvironment myEnvironment)
        {
            _transformEnvironment = myEnvironment;

            // Create a wrapper that manages persistence and comparison of FormatVersion
            // in our InstanceData stream.  We can read/write to this stream as needed (though CompressionTransform
            // does not because we don't house any non-FormatVersion data in the instance data stream).
            // We need to give out our current code version so it can compare with any file version as appropriate.
            _versionedStreamOwner = new VersionedStreamOwner(
                _transformEnvironment.GetPrimaryInstanceData(),
                new FormatVersion(_featureName, _minimumReaderVersion, _minimumUpdaterVersion, _currentFeatureVersion));
        }
Ejemplo n.º 2
0
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------
        /// <summary>
        /// Constructor to use for any stream that shares versioning information with another stream
        /// but is not the one that houses the FormatVersion data itself.
        /// </summary>
        /// <param name="baseStream"></param>
        /// <param name="versionOwner"></param>
        internal VersionedStream(Stream baseStream, VersionedStreamOwner versionOwner)
        {
            if (baseStream == null)
            {
                throw new ArgumentNullException("baseStream");
            }

            if (versionOwner == null)
            {
                throw new ArgumentNullException("versionOwner");
            }

            _stream       = baseStream;
            _versionOwner = versionOwner;
        }
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------
        /// <summary>
        /// Constructor to use for any stream that shares versioning information with another stream
        /// but is not the one that houses the FormatVersion data itself.
        /// </summary>
        /// <param name="baseStream"></param>
        /// <param name="versionOwner"></param>
        internal VersionedStream(Stream baseStream, VersionedStreamOwner versionOwner)
        {
            if (baseStream == null)
                throw new ArgumentNullException("baseStream");

            if (versionOwner == null)
                throw new ArgumentNullException("versionOwner");

            _stream = baseStream;
            _versionOwner = versionOwner;
        }
        RightsManagementEncryptionTransform(
            TransformEnvironment transformEnvironment
            )
        {
            Debug.Assert(transformEnvironment != null);
            
            Stream instanceDataStream = transformEnvironment.GetPrimaryInstanceData();

            Debug.Assert(instanceDataStream != null, SR.Get(SRID.NoPublishLicenseStream));

            _useLicenseStorage = transformEnvironment.GetInstanceDataStorage();

            Debug.Assert(_useLicenseStorage != null, SR.Get(SRID.NoUseLicenseStorage));

            // Create a wrapper that manages persistence and comparison of FormatVersion
            // in our InstanceData stream.  We can read/write to this stream as needed (though CompressionTransform
            // does not because we don't house any non-FormatVersion data in the instance data stream).
            // We need to give out our current code version so it can compare with any file version as appropriate.
            _publishLicenseStream = new VersionedStreamOwner(
                instanceDataStream,
                new FormatVersion(FeatureName, MinimumReaderVersion, MinimumUpdaterVersion, CurrentFeatureVersion));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="myEnvironment">environment</param>
        /// <remarks>this should only be used by the DataSpaceManager class</remarks>
        public CompressionTransform(TransformEnvironment myEnvironment)
        {
            _transformEnvironment = myEnvironment;

            // Create a wrapper that manages persistence and comparison of FormatVersion
            // in our InstanceData stream.  We can read/write to this stream as needed (though CompressionTransform
            // does not because we don't house any non-FormatVersion data in the instance data stream).
            // We need to give out our current code version so it can compare with any file version as appropriate.
            _versionedStreamOwner = new VersionedStreamOwner(
                _transformEnvironment.GetPrimaryInstanceData(),
                new FormatVersion(_featureName, _minimumReaderVersion, _minimumUpdaterVersion, _currentFeatureVersion));
        }