Partilhar via


ContentTypeWriter.ShouldCompressContent Method

Note

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)

Syntax

protected internal virtual bool ShouldCompressContent (
         TargetPlatform targetPlatform,
         Object value
)

Parameters

  • targetPlatform
    The target platform of the content build.
  • value
    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.

Remarks

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.

See Also

Reference

ContentTypeWriter Class
ContentTypeWriter Members
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler Namespace

Platforms

Windows XP SP2, Windows Vista