Gorgon
Show / Hide Table of Contents

Interface IContentPlugInService

Provides access to the various content specific plugins in the application.

Inherited Members
IDisabledPlugInService.DisabledPlugIns
Namespace: Gorgon.Editor.Services
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IContentPlugInService : IDisabledPlugInService

Properties

| Edit this page View Source

ContentFileManager

Property to set or return the currently active content file manager to pass to any plug ins.

Declaration
IContentFileManager ContentFileManager { get; set; }
Property Value
Type Description
IContentFileManager
| Edit this page View Source

Importers

Property to return the list of content importer plug ins loaded into the application.

Declaration
IReadOnlyDictionary<string, ContentImportPlugIn> Importers { get; }
Property Value
Type Description
IReadOnlyDictionary<string, ContentImportPlugIn>
| Edit this page View Source

PlugIns

Property to return the list of content plugins loaded in to the application.

Declaration
IReadOnlyDictionary<string, ContentPlugIn> PlugIns { get; }
Property Value
Type Description
IReadOnlyDictionary<string, ContentPlugIn>

Methods

| Edit this page View Source

GetContentImporter(string)

Function to retrieve the appropriate content importer for the file specified.

Declaration
IEditorContentImporter GetContentImporter(string filePath)
Parameters
Type Name Description
string filePath

The path to the file to evaluate.

Returns
Type Description
IEditorContentImporter

A IEditorContentImporter, or null if none was found.

Remarks

Since the content importers are meant for importing into the project virtual file system, the filePath must point to a file on the physical file system.

| Edit this page View Source

GetContentPlugIn(ProjectItemMetadata)

Function to retrieve the actual plug in based on the name associated with the project metadata item.

Declaration
(ContentPlugIn plugin, MetadataPlugInState state) GetContentPlugIn(ProjectItemMetadata metadata)
Parameters
Type Name Description
ProjectItemMetadata metadata

The metadata item to evaluate.

Returns
Type Description
(ContentPlugIn plugin, MetadataPlugInState state)

The plug in, and the MetadataPlugInState used to evaluate whether a deep inspection is required.

| Edit this page View Source

ProjectActivated(IGorgonFileSystem, IContentFileManager, IGorgonFileSystemWriter<Stream>)

Function called when a project is loaded/created.

Declaration
void ProjectActivated(IGorgonFileSystem projectFileSystem, IContentFileManager fileManager, IGorgonFileSystemWriter<Stream> temporaryFileSystem)
Parameters
Type Name Description
IGorgonFileSystem projectFileSystem

The read only file system used by the project.

IContentFileManager fileManager

The content file manager for the project.

IGorgonFileSystemWriter<Stream> temporaryFileSystem

The file system used to hold temporary working data.

| Edit this page View Source

ProjectDeactivated()

Function called when a project is unloaded.

Declaration
void ProjectDeactivated()
| Edit this page View Source

ReadContentSettings<T>(string, params JsonConverter[])

Funcion to read the settings for a content plug in from a JSON file.

Declaration
T ReadContentSettings<T>(string name, params JsonConverter[] converters) where T : class
Parameters
Type Name Description
string name

The name of the file.

JsonConverter[] converters

A list of JSON data converters.

Returns
Type Description
T

The settings object for the plug in, or null if no settings file was found for the plug in.

Type Parameters
Name Description
T

The type of settings to read. Must be a reference type.

Remarks

This will read in the settings for a content plug from the same location where the editor stores its application settings file.

| Edit this page View Source

WriteContentSettings<T>(string, T, params JsonConverter[])

Function to write out the settings for a content plug in as a JSON file.

Declaration
void WriteContentSettings<T>(string name, T contentSettings, params JsonConverter[] converters) where T : class
Parameters
Type Name Description
string name

The name of the file.

T contentSettings

The content settings to persist as JSON file.

JsonConverter[] converters

A list of JSON converters.

Type Parameters
Name Description
T

The type of settings to write. Must be a reference type.

Remarks

This will write out the settings for a content plug in to the same location where the editor stores its application settings file.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author