Class PipelineManager
- 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
projectDirstringThe directory that contains the content project.
outputDirstringThe directory that contains the results of the project.
intermediateDirstringThe 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
CompressContent
Gets or sets if the content is compressed.
public bool CompressContent { get; set; }
Property Value
Config
The build configuration passed thru to content processors.
public string Config { get; set; }
Property Value
ContentStats
Gets the content stats of the previous build.
public ContentStatsCollection ContentStats { get; }
Property Value
IntermediateDirectory
Gets or sets the directory that is used for temporary files created by the content build process.
public string IntermediateDirectory { get; }
Property Value
Logger
Gets or sets the content build logger.
public ContentBuildLogger Logger { get; set; }
Property Value
OutputDirectory
Gets or sets the directory that contains the results of the project.
public string OutputDirectory { get; }
Property Value
Platform
The current target platform for which all content is built.
public TargetPlatform Platform { get; set; }
Property Value
Profile
The current target graphics profile for which all content is built.
public GraphicsProfile Profile { get; set; }
Property Value
ProjectDirectory
Gets or sets the directory that contains the content project.
public string ProjectDirectory { get; }
Property Value
Quiet
If true, messages which are non-essential to the build process will be suppressed.
public bool Quiet { get; set; }
Property Value
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
Methods
AddAssembly(string)
Adds an assembly to be used by the pipeline.
public void AddAssembly(string assemblyFilePath)
Parameters
assemblyFilePathstringAssembly 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
TTypeType to be converted.
TTypeConverterType 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
sourceFilepathstringSource file path.
outputFilepathstringOutput file path.
importerNamestringName of the importer to use.
processorNamestringName of the processor to use.
processorParametersOpaqueDataDictionaryOpaque 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
CreateImporter(string)
Creates an instance of an importer.
public IContentImporter CreateImporter(string name)
Parameters
namestringName of the importer.
Returns
- IContentImporter
Content importer.
CreateProcessor(string, OpaqueDataDictionary)
Creates an instance of a processor.
public IContentProcessor CreateProcessor(string name, OpaqueDataDictionary processorParameters)
Parameters
namestringName of the processor.
processorParametersOpaqueDataDictionaryOpaque 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
importerstringName of the importer.
Returns
FindImporterByExtension(string)
Returns the importer type name based on the file extension.
public string FindImporterByExtension(string ext)
Parameters
extstringFile extension to search for.
Returns
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
sourceFileNamestringThe source file name.
importerNamestringThe name of the content importer. Can be null.
processorNamestringThe name of the content processor. Can be null.
processorParametersOpaqueDataDictionaryThe processor parameters. Can be null.
Returns
- string
The asset name.
GetImporterAssemblyTimestamp(string)
Gets the importer assembly timestamp.
public DateTime GetImporterAssemblyTimestamp(string name)
Parameters
namestringAssembly 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
namestringName of the processor.
Returns
- DateTime
Timestamp.
GetProcessorDefaultValues(string)
Gets the default values for the content processor parameters.
public OpaqueDataDictionary GetProcessorDefaultValues(string processorName)
Parameters
processorNamestringThe 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
namestringName of the processor.
Returns
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
pipelineEventPipelineBuildEventPipeline 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
sourceFilepathstringSource file path.
outputFilepathstringOutput file path.
importerNamestringName of the importer to use.
processorNamestringName of the processor to use.
processorParametersOpaqueDataDictionaryOpaque 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
sourceFilepathstringPath of the source file.
importerNamestringName of the importer.
processorNamestringName 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
namestringName of the processor type.
processorParametersOpaqueDataDictionaryOpaque data dictionary containing the processor parameters.
Returns
- OpaqueDataDictionary
Opaque data dictionary containing the validated parameters.