ContentTypeWriter.ShouldCompressContent Method

This method is available only when developing for Windows.
Indicates whether a given type of content should be compressed.

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

protected internal virtual bool ShouldCompressContent (
         TargetPlatform targetPlatform,
         Object value


Type: TargetPlatform
The target platform of the content build.
Type: Object
The object about to be serialized, or null if a collection of objects is to be serialized.

Return Value

true if the content of the requested type should be compressed; false otherwise.

This base class implementation of this method always returns true. It should be overridden to return false if there would be little or no useful reduction in size of the content type's data from a general-purpose lossless compression algorithm.

The implementations for Song Class and SoundEffect Class data return false because data for these content types is already in compressed form.

Windows 7, Windows Vista, Windows XP

Community Additions