ContentProcessorContext

class ContentProcessorContext : System.Object

Provides access to custom processor parameters, methods for converting member data, and triggering nested builds.

readonly string BuildConfiguration

Gets the name of the current content build configuration.

readonly string IntermediateDirectory

Gets the path of the directory that will contain any intermediate files generated by the content processor.

readonly ContentBuildLogger Logger

Gets the logger interface used for status messages or warnings.

readonly string OutputDirectory

Gets the output path of the content processor.

readonly string OutputFilename

Gets the output file name of the content processor.

readonly OpaqueDataDictionary Parameters

Gets the collection of parameters used by the content processor.

readonly TargetPlatform TargetPlatform

Gets the current content build target platform.

readonly GraphicsProfile TargetProfile

Gets the current content build target profile.

public abstract void AddDependency(string filename)

Adds a dependency to the specified file. This causes a rebuild of the file, when modified, on subsequent incremental builds.

Parameters:
  • filename (string) – Name of an asset file.
public abstract void AddOutputFile(string filename)

Add a file name to the list of related output files maintained by the build item. This allows tracking build items that build multiple output files.

Parameters:
  • filename (string) – The name of the file.
public Microsoft.Xna.Framework.Content.Pipeline.TOutput BuildAndLoadAsset<TInput, TOutput>(Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput> sourceAsset, string processorName)

Initiates a nested build of the specified asset and then loads the result into memory.

Type Parameters:
 
  • TInput – Type of the input.
  • TOutput – Type of the converted output.
Parameters:
  • sourceAsset (Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput>) – Reference to the source asset.
  • processorName (string) – Optional processor for this content.
Returns:

Copy of the final converted content.

public abstract Microsoft.Xna.Framework.Content.Pipeline.TOutput BuildAndLoadAsset<TInput, TOutput>(Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName)

Initiates a nested build of the specified asset and then loads the result into memory.

Type Parameters:
 
  • TInput – Type of the input.
  • TOutput – Type of the converted output.
Parameters:
  • sourceAsset (Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput>) – Reference to the source asset.
  • processorName (string) – Optional processor for this content.
  • processorParameters (Microsoft.Xna.Framework.Content.Pipeline.OpaqueDataDictionary) – Optional collection of named values available as input to the content processor.
  • importerName (string) – Optional importer for this content.
Returns:

Copy of the final converted content.

public Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TOutput> BuildAsset<TInput, TOutput>(Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput> sourceAsset, string processorName)

Initiates a nested build of an additional asset.

Type Parameters:
 
  • TInput – Type of the input.
  • TOutput – Type of the output.
Parameters:
  • sourceAsset (Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput>) – Reference to the source asset.
  • processorName (string) – Optional processor for this content.
Returns:

Reference to the final compiled content. The build work is not required to complete before returning. Therefore, this file may not be up to date when BuildAsset returns but it will be available for loading by the game at runtime.

public abstract Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TOutput> BuildAsset<TInput, TOutput>(Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput> sourceAsset, string processorName, OpaqueDataDictionary processorParameters, string importerName, string assetName)

Initiates a nested build of an additional asset.

Type Parameters:
 
  • TInput – Type of the input.
  • TOutput – Type of the output.
Parameters:
  • sourceAsset (Microsoft.Xna.Framework.Content.Pipeline.ExternalReference<TInput>) – Reference to the source asset.
  • processorName (string) – Optional processor for this content.
  • processorParameters (Microsoft.Xna.Framework.Content.Pipeline.OpaqueDataDictionary) – Optional collection of named values available as input to the content processor.
  • importerName (string) – Optional importer for this content.
  • assetName (string) – Optional name of the final compiled content.
Returns:

Reference to the final compiled content. The build work is not required to complete before returning. Therefore, this file may not be up to date when BuildAsset returns but it will be available for loading by the game at runtime.

public Microsoft.Xna.Framework.Content.Pipeline.TOutput Convert<TInput, TOutput>(Microsoft.Xna.Framework.Content.Pipeline.TInput input, string processorName)
Type Parameters:
 
  • TInput
  • TOutput
Parameters:
  • input (Microsoft.Xna.Framework.Content.Pipeline.TInput) –
  • processorName (string) –
public abstract Microsoft.Xna.Framework.Content.Pipeline.TOutput Convert<TInput, TOutput>(Microsoft.Xna.Framework.Content.Pipeline.TInput input, string processorName, OpaqueDataDictionary processorParameters)
Type Parameters:
 
  • TInput
  • TOutput
Parameters:
  • input (Microsoft.Xna.Framework.Content.Pipeline.TInput) –
  • processorName (string) –
  • processorParameters (Microsoft.Xna.Framework.Content.Pipeline.OpaqueDataDictionary) –