C# Class Axiom.Overlays.OverlayElementManager

This class acts as a repository and regitrar of overlay components.
OverlayElementManager's job is to manage the lifecycle of OverlayElement (subclass) instances, and also to register plugin suppliers of new components.
Inheritance: IDisposable
Mostra file Open project: WolfgangSt/axiom Class Usage Examples

Private Properties

Property Type Description
GetElementTable OverlayElement>.Dictionary
OverlayElementManager System

Public Methods

Method Description
AddElementFactory ( IOverlayElementFactory factory ) : void

Registers a new OverlayElementFactory with this manager.

Should be used by plugins or other apps wishing to provide a new OverlayElement subclass.

CloneOverlayElementFromTemplate ( string template, string name ) : OverlayElement

Clones an overlay element from a template

CreateElement ( string typeName, string instanceName ) : OverlayElement

Creates a new OverlayElement of the type requested.

CreateElement ( string typeName, string instanceName, bool isTemplate ) : OverlayElement

Creates a new OverlayElement of the type requested.

CreateElementFromFactory ( string typeName, string instanceName ) : OverlayElement

Creates an element of the specified type, with the specified name

A factory must be available to handle the requested type, or an exception will be thrown.

CreateElementFromTemplate ( string templateName, string typeName, string instanceName ) : OverlayElement

CreateElementFromTemplate ( string templateName, string typeName, string instanceName, bool isTemplate ) : OverlayElement

DestroyAllElements ( ) : void

destroys all OverlayElements

DestroyAllElements ( bool isTemplate ) : void

destroys all OverlayElements

DestroyElement ( OverlayElement element ) : void

Destroys the supplied OvelayElement

DestroyElement ( OverlayElement element, bool isTemplate ) : void

Destroys the supplied OvelayElement

DestroyElement ( string name ) : void

Destroys the specified OverlayElement

DestroyElement ( string name, bool isTemplate ) : void

Destroys the specified OverlayElement

GetElement ( string name ) : OverlayElement

Gets a reference to an existing element.

GetElement ( string name, bool isTemplate ) : OverlayElement

Gets a reference to an existing element.

Protected Methods

Method Description
dispose ( bool disposeManagedResources ) : void

Called when the engine is shutting down.

Private Methods

Method Description
GetElementTable ( bool isTemplate ) : OverlayElement>.Dictionary

Quick helper method to return the lookup table for the right element type.

OverlayElementManager ( ) : System

Internal constructor. This class cannot be instantiated externally.

Method Details

AddElementFactory() public method

Registers a new OverlayElementFactory with this manager.
Should be used by plugins or other apps wishing to provide a new OverlayElement subclass.
public AddElementFactory ( IOverlayElementFactory factory ) : void
factory IOverlayElementFactory
return void

CloneOverlayElementFromTemplate() public method

Clones an overlay element from a template
public CloneOverlayElementFromTemplate ( string template, string name ) : OverlayElement
template string template to clone
name string name of the new element
return OverlayElement

CreateElement() public method

Creates a new OverlayElement of the type requested.
public CreateElement ( string typeName, string instanceName ) : OverlayElement
typeName string The type of element to create is passed in as a string because this /// allows plugins to register new types of component.
instanceName string The type of element to create.
return OverlayElement

CreateElement() public method

Creates a new OverlayElement of the type requested.
public CreateElement ( string typeName, string instanceName, bool isTemplate ) : OverlayElement
typeName string The type of element to create is passed in as a string because this /// allows plugins to register new types of component.
instanceName string The type of element to create.
isTemplate bool
return OverlayElement

CreateElementFromFactory() public method

Creates an element of the specified type, with the specified name
A factory must be available to handle the requested type, or an exception will be thrown.
public CreateElementFromFactory ( string typeName, string instanceName ) : OverlayElement
typeName string
instanceName string
return OverlayElement

CreateElementFromTemplate() public method

public CreateElementFromTemplate ( string templateName, string typeName, string instanceName ) : OverlayElement
templateName string
typeName string
instanceName string
return OverlayElement

CreateElementFromTemplate() public method

public CreateElementFromTemplate ( string templateName, string typeName, string instanceName, bool isTemplate ) : OverlayElement
templateName string
typeName string
instanceName string
isTemplate bool
return OverlayElement

DestroyAllElements() public method

destroys all OverlayElements
public DestroyAllElements ( ) : void
return void

DestroyAllElements() public method

destroys all OverlayElements
public DestroyAllElements ( bool isTemplate ) : void
isTemplate bool
return void

DestroyElement() public method

Destroys the supplied OvelayElement
public DestroyElement ( OverlayElement element ) : void
element OverlayElement
return void

DestroyElement() public method

Destroys the supplied OvelayElement
public DestroyElement ( OverlayElement element, bool isTemplate ) : void
element OverlayElement
isTemplate bool
return void

DestroyElement() public method

Destroys the specified OverlayElement
public DestroyElement ( string name ) : void
name string
return void

DestroyElement() public method

Destroys the specified OverlayElement
public DestroyElement ( string name, bool isTemplate ) : void
name string
isTemplate bool
return void

GetElement() public method

Gets a reference to an existing element.
public GetElement ( string name ) : OverlayElement
name string Name of the element to retrieve.
return OverlayElement

GetElement() public method

Gets a reference to an existing element.
public GetElement ( string name, bool isTemplate ) : OverlayElement
name string Name of the element to retrieve.
isTemplate bool
return OverlayElement

dispose() protected method

Called when the engine is shutting down.
protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
return void