Table of Contents

Class PipelineManager

Namespace
MonoGame.Framework.Content.Pipeline.Builder
Assembly
MonoGame.Framework.Content.Pipeline.dll

Class to provide methods and properties for handling content pipelines.

public class PipelineManager
Inheritance
PipelineManager
Inherited Members

Constructors

PipelineManager(string, string, string)

Creates a new instance of PipelineManager.

public PipelineManager(string projectDir, string outputDir, string intermediateDir)

Parameters

projectDir string

The directory that contains the content project.

outputDir string

The directory that contains the results of the project.

intermediateDir string

The directory that is used for temporary files created by the content build process

Properties

Assemblies

Gets the list of assemblies referenced by the content project file.

public List<string> Assemblies { get; }

Property Value

List<string>

CompressContent

Gets or sets if the content is compressed.

public bool CompressContent { get; set; }

Property Value

bool

Config

The build configuration passed thru to content processors.

public string Config { get; set; }

Property Value

string

ContentStats

Gets the content stats of the previous build.

public ContentStatsCollection ContentStats { get; }

Property Value

ContentStatsCollection

IntermediateDirectory

Gets or sets the directory that is used for temporary files created by the content build process.

public string IntermediateDirectory { get; }

Property Value

string

Logger

Gets or sets the content build logger.

public ContentBuildLogger Logger { get; set; }

Property Value

ContentBuildLogger

OutputDirectory

Gets or sets the directory that contains the results of the project.

public string OutputDirectory { get; }

Property Value

string

Platform

The current target platform for which all content is built.

public TargetPlatform Platform { get; set; }

Property Value

TargetPlatform

Profile

The current target graphics profile for which all content is built.

public GraphicsProfile Profile { get; set; }

Property Value

GraphicsProfile

ProjectDirectory

Gets or sets the directory that contains the content project.

public string ProjectDirectory { get; }

Property Value

string

Quiet

If true, messages which are non-essential to the build process will be suppressed.

public bool Quiet { get; set; }

Property Value

bool

RethrowExceptions

If true exceptions thrown from within an importer or processor are caught and then thrown from the context. Default value is true.

public bool RethrowExceptions { get; set; }

Property Value

bool

Methods

AddAssembly(string)

Adds an assembly to be used by the pipeline.

public void AddAssembly(string assemblyFilePath)

Parameters

assemblyFilePath string

Assembly file path.

Exceptions

ArgumentException

Thrown if the assembly file path is not absolute or null.

AssignTypeConverter<TType, TTypeConverter>()

Assigns a type converter for a type

public void AssignTypeConverter<TType, TTypeConverter>()

Type Parameters

TType

Type to be converted.

TTypeConverter

Type converter to be applied to the type.

BuildContent(string, string, string, string, OpaqueDataDictionary)

Content builder.

public PipelineBuildEvent BuildContent(string sourceFilepath, string outputFilepath = null, string importerName = null, string processorName = null, OpaqueDataDictionary processorParameters = null)

Parameters

sourceFilepath string

Source file path.

outputFilepath string

Output file path.

importerName string

Name of the importer to use.

processorName string

Name of the processor to use.

processorParameters OpaqueDataDictionary

Opaque data dictionary containing the processor parameters.

Returns

PipelineBuildEvent

PipelineBuildEvent instance.

CleanContent(string, string)

Cleans content from the intermediate folder.

public void CleanContent(string sourceFilepath, string outputFilepath = null)

Parameters

sourceFilepath string

Path of the source file.

outputFilepath string

Path of the output file.

CreateImporter(string)

Creates an instance of an importer.

public IContentImporter CreateImporter(string name)

Parameters

name string

Name of the importer.

Returns

IContentImporter

Content importer.

CreateProcessor(string, OpaqueDataDictionary)

Creates an instance of a processor.

public IContentProcessor CreateProcessor(string name, OpaqueDataDictionary processorParameters)

Parameters

name string

Name of the processor.

processorParameters OpaqueDataDictionary

Opaque data dictionary containing the processor parameters.

Returns

IContentProcessor

Content processor.

FindDefaultProcessor(string)

Gets the default processor for an importer.

public string FindDefaultProcessor(string importer)

Parameters

importer string

Name of the importer.

Returns

string

Name of the processor or null if not found.

FindImporterByExtension(string)

Returns the importer type name based on the file extension.

public string FindImporterByExtension(string ext)

Parameters

ext string

File extension to search for.

Returns

string

Importer type name or null if not found.

GetAssetName(string, string, string, OpaqueDataDictionary)

Gets an automatic asset name, such as "AssetName_0".

public string GetAssetName(string sourceFileName, string importerName, string processorName, OpaqueDataDictionary processorParameters)

Parameters

sourceFileName string

The source file name.

importerName string

The name of the content importer. Can be null.

processorName string

The name of the content processor. Can be null.

processorParameters OpaqueDataDictionary

The processor parameters. Can be null.

Returns

string

The asset name.

GetImporterAssemblyTimestamp(string)

Gets the importer assembly timestamp.

public DateTime GetImporterAssemblyTimestamp(string name)

Parameters

name string

Assembly name.

Returns

DateTime

Timestamp.

GetImporterTypes()

Gets the importer types.

public Type[] GetImporterTypes()

Returns

Type[]

Array of types.

GetProcessorAssemblyTimestamp(string)

Gets the timestamp of the processor assembly.

public DateTime GetProcessorAssemblyTimestamp(string name)

Parameters

name string

Name of the processor.

Returns

DateTime

Timestamp.

GetProcessorDefaultValues(string)

Gets the default values for the content processor parameters.

public OpaqueDataDictionary GetProcessorDefaultValues(string processorName)

Parameters

processorName string

The name of the content processor.

Returns

OpaqueDataDictionary

A dictionary containing the default value for each parameter. Returns null if the content processor has not been created yet.

GetProcessorType(string)

Gets the processor type.

public Type GetProcessorType(string name)

Parameters

name string

Name of the processor.

Returns

Type

Type of the processor or null if not found.

GetProcessorTypes()

Gets the processor types.

public Type[] GetProcessorTypes()

Returns

Type[]

Array of types.

ProcessContent(PipelineBuildEvent)

Processes the content from the pipeline event.

public object ProcessContent(PipelineBuildEvent pipelineEvent)

Parameters

pipelineEvent PipelineBuildEvent

Pipeline event.

Returns

object

Object processed by the pipeline.

Exceptions

PipelineException

Thrown if there was an error processing the content.

RegisterContent(string, string, string, string, OpaqueDataDictionary)

Registers content to be processed by the pipeline manager.

public void RegisterContent(string sourceFilepath, string outputFilepath = null, string importerName = null, string processorName = null, OpaqueDataDictionary processorParameters = null)

Parameters

sourceFilepath string

Source file path.

outputFilepath string

Output file path.

importerName string

Name of the importer to use.

processorName string

Name of the processor to use.

processorParameters OpaqueDataDictionary

Opaque data dictionary containing the processor parameters.

ResolveImporterAndProcessor(string, ref string, ref string)

Resolves the importer and processor names.

public void ResolveImporterAndProcessor(string sourceFilepath, ref string importerName, ref string processorName)

Parameters

sourceFilepath string

Path of the source file.

importerName string

Name of the importer.

processorName string

Name of the processor.

Exceptions

Exception

Thrown if a default importer or processor could not be found.

ValidateProcessorParameters(string, OpaqueDataDictionary)

Validate a list of processor parameters for a given processor type.

public OpaqueDataDictionary ValidateProcessorParameters(string name, OpaqueDataDictionary processorParameters)

Parameters

name string

Name of the processor type.

processorParameters OpaqueDataDictionary

Opaque data dictionary containing the processor parameters.

Returns

OpaqueDataDictionary

Opaque data dictionary containing the validated parameters.