C# Class StructureMap.Graph.PluginFamily

Conceptually speaking, a PluginFamily object represents a point of abstraction or variability in the system. A PluginFamily defines a CLR Type that StructureMap can build, and all of the possible Plugin’s implementing the CLR Type.
Inheritance: HasLifecycle, IDisposable
Show file Open project: structuremap/structuremap Class Usage Examples

Public Methods

Method Description
AddInstance ( StructureMap.Pipeline.Instance instance ) : void

Add an additional Instance to this PluginFamily/PluginType

AddType ( Type concreteType ) : void

Add a single concrete type as a new Instance with a derived name. Is idempotent.

AddType ( Type concreteType, string name ) : void

Adds a new Instance for the concreteType with a name

CreateTemplatedClone ( Type templateTypes ) : PluginFamily

If the PluginType is an open generic type, this method will create a closed type copy of this PluginFamily

GetDefaultInstance ( ) : StructureMap.Pipeline.Instance

Determine the default instance if it can. May return null.

GetInstance ( string name ) : StructureMap.Pipeline.Instance

Find a named instance for this PluginFamily

PluginFamily ( Type pluginType ) : System
RemoveAll ( ) : void

Removes all Instances and resets the default Instance determination

RemoveInstance ( StructureMap.Pipeline.Instance instance ) : void

completely removes an Instance from a PluginFamily

SetDefault ( StructureMap.Pipeline.Instance instance ) : void

Sets the default Instance.

Private Methods

Method Description
ExplicitOverride ( Type pluginType, object @default ) : PluginFamily
IDisposable ( ) : void
PluginFamily ( Type pluginType, object @default ) : System
assertInstanceIsValidForThisPluginType ( StructureMap.Pipeline.Instance instance ) : void
determineDefault ( ) : StructureMap.Pipeline.Instance
hasType ( Type concreteType ) : bool
resetDefault ( ) : void

Method Details

AddInstance() public method

Add an additional Instance to this PluginFamily/PluginType
public AddInstance ( StructureMap.Pipeline.Instance instance ) : void
instance StructureMap.Pipeline.Instance
return void

AddType() public method

Add a single concrete type as a new Instance with a derived name. Is idempotent.
public AddType ( Type concreteType ) : void
concreteType System.Type
return void

AddType() public method

Adds a new Instance for the concreteType with a name
public AddType ( Type concreteType, string name ) : void
concreteType System.Type
name string
return void

CreateTemplatedClone() public method

If the PluginType is an open generic type, this method will create a closed type copy of this PluginFamily
public CreateTemplatedClone ( Type templateTypes ) : PluginFamily
templateTypes System.Type
return PluginFamily

GetDefaultInstance() public method

Determine the default instance if it can. May return null.
public GetDefaultInstance ( ) : StructureMap.Pipeline.Instance
return StructureMap.Pipeline.Instance

GetInstance() public method

Find a named instance for this PluginFamily
public GetInstance ( string name ) : StructureMap.Pipeline.Instance
name string
return StructureMap.Pipeline.Instance

PluginFamily() public method

public PluginFamily ( Type pluginType ) : System
pluginType System.Type
return System

RemoveAll() public method

Removes all Instances and resets the default Instance determination
public RemoveAll ( ) : void
return void

RemoveInstance() public method

completely removes an Instance from a PluginFamily
public RemoveInstance ( StructureMap.Pipeline.Instance instance ) : void
instance StructureMap.Pipeline.Instance
return void

SetDefault() public method

Sets the default Instance.
public SetDefault ( StructureMap.Pipeline.Instance instance ) : void
instance StructureMap.Pipeline.Instance
return void