StructureMap
Get the object of type T that is valid for this build session.
Get the object of type T that is valid for this build session by name.
Register a default object for the given PluginType that will
be used throughout the rest of the current object request
Same as GetInstance, but can gracefully return null if
the Type does not already exist
Same as GetInstance(name), but can gracefully return null if
the Type and name does not already exist
Gets all objects in the current object graph that can be cast
to T
Gets a reference to the BuildStack for this build session
The concrete type of the immediate parent object in the object graph
Gets the root "frame" of the object request
The requested instance name of the object graph
Expression Builder that has grammars for defining policies at the
PluginType level. This expression is used for registering
open generic types
Convenience method that sets the default concrete type of the PluginType. The "concreteType"
can only accept types that do not have any primitive constructor arguments.
StructureMap has to know how to construct all of the constructor argument types.
Shorter way to call TheDefaultIsConcreteType
Shortcut method to add an additional Instance to this Plugin Type
as just a Concrete Type. This will only work if the Concrete Type
has no primitive constructor or mandatory Setter arguments.
Sets the object creation of the instances of the PluginType. For example: PerRequest,
Singleton, ThreadLocal, HttpContext, or Hybrid
Register an Action to run against any object of this PluginType immediately after
it is created, but before the new object is passed back to the caller
Register a Func to run against any object of this PluginType immediately after it is created,
but before the new object is passed back to the caller. Unlike OnCreation(),
EnrichWith() gives the the ability to return a different object. Use this method for runtime AOP
scenarios or to return a decorator.
Register a Func to run against any object of this PluginType immediately after it is created,
but before the new object is passed back to the caller. Unlike OnCreation(),
EnrichWith() gives the the ability to return a different object. Use this method for runtime AOP
scenarios or to return a decorator.
Registers an IBuildInterceptor for this Plugin Type that executes before
any object of this PluginType is created. IBuildInterceptor's can be
used to create a custom scope
Shortcut method to add an additional Instance to this Plugin Type
as just a Concrete Type. You can also chain other declarations after
this method to add constructor and setter arguments
Shortcut method to add an additional Instance to this Plugin Type
as just a Concrete Type by a specified name. You can also chain other declarations after
this method to add constructor and setter arguments
Specify the value of this explicit argument
Pass in additional arguments by type T
Pass in additional arguments by type
Pass in additional arguments by name
Gets the default instance of type T using the explicitly configured arguments from the "args"
Gets a named instance of type T using the explicitly configured arguments from teh "args"
Gets the default instance of the pluginType using the explicitly configured arguments from the "args"
Gets all configured instances of type T using explicitly configured arguments
Determines if the pluggedType can be upcast to the pluginType
Determines if the PluggedType is a valid Plugin into the
PluginType
Returns the System.Reflection.ConstructorInfo for the PluggedType. Uses either
the "greediest" constructor with the most arguments or the constructor function
marked with the [DefaultConstructor]
The InstanceKey of the default instance of the PluginFamily
The CLR Type that defines the "Plugin" interface for the PluginFamily
Add an Assembly to the scanning operation
Add an Assembly by name to the scanning operation
Add the currently executing Assembly to the scanning operation
Add the Assembly that contains type T to the scanning operation
Add the Assembly that contains type to the scanning operation
Sweep the designated path and add any Assembly's found in this folder to the
scanning operation
Sweep the designated path and add any Assembly's found in this folder to the
scanning operation. The assemblyFilter can be used to filter or limit the
Assembly's that are picked up.
Adds an ITypeScanner object to the scanning operation
Adds the DefaultConventionScanner to the scanning operations. I.e., a concrete
class named "Something" that implements "ISomething" will be automatically
added to PluginType "ISomething"
Creates and adds a new ITypeScanner of type T to this scanning operation
Directs the scanning operation to automatically detect and include any Registry
classes found in the Assembly's being scanned
Add all concrete types of the Plugin Type as Instances of Plugin Type
Add all concrete types of the Plugin Type as Instances of Plugin Type
Makes this scanning operation ignore all [PluginFamily] and [Pluggable] attributes
Exclude types that match the Predicate from being scanned
Exclude all types in this nameSpace or its children from the scanning operation
Exclude all types in this nameSpace or its children from the scanning operation
Only include types matching the Predicate in the scanning operation. You can
use multiple Include() calls in a single scanning operation
Only include types from this nameSpace or its children in the scanning operation. You can
use multiple Include() calls in a single scanning operation
Only include types from this nameSpace or its children in the scanning operation. You can
use multiple Include() calls in a single scanning operation
Exclude this specific type from the scanning operation
Scans for PluginType's and Concrete Types that close the given open generic type
A TypeInterceptor that is only applied if the MatchesType()
method is true for a given Type
An InstanceInterceptor can be registered on a per-Instance basis
to act on, or even replace, the object that is created before
it is passed back to the caller. This is primarily a hook
for runtime AOP scenarios.
Does this TypeInterceptor apply to the given type?
Specify how objects matching the Type predicate
will be intercepted
Specify how objects matching the Type predicate
will be intercepted
An Instance class that builds objects by calling a constructor function on a concrete type
and filling setter properties. ConfiguredInstance should only be used for open generic types.
Favor SmartInstance{T} for all other usages.
The actual concrete type of this Instance. Not every type of IInstance
can determine the ConcreteType
Register an Action to perform on the object created by this Instance
before it is returned to the caller
Register an Action to perform on the object created by this Instance
before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Inline definition of a dependency array like IService[] or IHandler[]
Inline definition of a dependency array like IService[] or IHandler[]
Inline definition of a dependency array like IService[] or IHandler[]
Start the definition of a child instance for type CONSTRUCTORARGUMENTTYPE
Inline definition of a constructor or a setter property dependency
Starts the definition of a child instance specifying the argument name
in the case of a constructor function that consumes more than one argument
of type T
Inline definition of a constructor dependency
Inline definition of a setter dependency
Start the definition of a primitive argument to a constructor argument
Configure a primitive constructor argument
Configures an array of Instance's for the array dependency
Part of the Fluent Interface, represents a nonprimitive argument to a
constructure function
Use a previously configured and named instance for the child
Start the definition of a child instance by defining the concrete type
Registers a configured instance to use as the argument to the parent's
constructor
Directs StructureMap to fill this dependency with the Default Instance of the
constructor or property type
Base class for many of the Instance subclasses to support
method chaining in the Registry DSL for common options
Set the name of this Instance
Register an Action to perform on the object created by this Instance
before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Register an InstanceInterceptor with this Instance
Used to override the constructor of a class to be used by StructureMap to create
a Pluggable object
Examines a System.Type object and determines the ConstructorInfo to use in creating
instances of the Type
Used to implicitly mark a class as a Plugin candidate for StructureMap
Determines whether a Type object is marked as Pluggable
The ConcreteKey alias of the Type
Declares a class, abstract class, or interface to be the target of a PluginFamily in the container
Determines if a Type object is marked as a PluginFamily
If set, determines the shared "scope" of the instance -- PerRequest, Singleton, ThreadLocal,
HttpContext, etc.
InstanceKey of the default instance. Used to implicitly define the default without
declaring the instance in StructureMap.config
Declares the target to be built by StructureMap as a Singleton. One object instance will
be created for each named instance
Marks a Property in a Pluggable class as filled by setter injection
Marks a method with no parameters as a method that validates an instance. StructureMap
uses this method to validate the configuration file. If the method does not throw an
exception, the object is assumed to be valid.
Returns an array of any MethodInfo's on a Type that are marked as ValidationMethod
CLR Type to search for validation methods
Constants for the names of Xml nodes and attributes in the StructureMap.config
file
The name of the default configuration file. The value is always StructurMap.config
Returns the absolute path to the StructureMap.config file
Expression Builder that has grammars for defining policies at the
PluginType level
Add multiple Instance's to this PluginType
Convenience method that sets the default concrete type of the PluginType. Type T
can only accept types that do not have any primitive constructor arguments.
StructureMap has to know how to construct all of the constructor argument types.
Shorthand to say TheDefault.Is.ConstructedBy(func)
Sets the object creation of the instances of the PluginType. For example: PerRequest,
Singleton, ThreadLocal, HttpContext, or Hybrid
Convenience method to mark a PluginFamily as a Singleton
Register an Action to run against any object of this PluginType immediately after
it is created, but before the new object is passed back to the caller
Adds an Interceptor to only this PluginType
Register an Action to run against any object of this PluginType immediately after
it is created, but before the new object is passed back to the caller
Register a Func to run against any object of this PluginType immediately after it is created,
but before the new object is passed back to the caller. Unlike OnCreation(),
EnrichWith() gives the the ability to return a different object. Use this method for runtime AOP
scenarios or to return a decorator.
Register a Func to run against any object of this PluginType immediately after it is created,
but before the new object is passed back to the caller. Unlike OnCreation(),
EnrichWith() gives the the ability to return a different object. Use this method for runtime AOP
scenarios or to return a decorator.
Shortcut method to add an additional Instance to this Plugin Type
as just a Concrete Type. This will only work if the Concrete Type
has no primitive constructor or mandatory Setter arguments.
Registers an ILifecycle for this Plugin Type that executes before
any object of this PluginType is created. ILifecycle's can be
used to create a custom scope
Largely deprecated and unnecessary with the ability to add Xml configuration files
Forces StructureMap to always use a unique instance to
stop the "BuildSession" caching
Define the Default Instance for this PluginType
Expression class to help define a runtime Profile
Starts the definition of the default instance for the containing Profile. This is
still valid, but Type() is recommended
Designate or define the Instance for a type within
this Profile
Use statement to define the Profile defaults for a Generic type
Expression Builder inside of a Profile creation for
open generic types
Use this concreteType for the Instance of this Profile for the PluginType
Use this Instance for the Profile Instance of this Plugin Type
Use the named Instance as the Profile Instance for this PluginType
Expression Builder within defining a Profile
Use a named, preconfigured instance as the default instance for this profile
Define the default instance of the PluginType for the containing Profile
For this Profile, use an Instance with this Func
For this Profile, use this object
For this Profile, use the Concrete Type
Use to programmatically select the constructor function of a concrete
class. Applies globally to all Containers in a single AppDomain.
Use to "forward" the request for FROM to the default of TO
Useful for singleton services that implement multiple
interface roles
A Registry class provides methods and grammars for configuring a Container or ObjectFactory.
Using a Registry subclass is the recommended way of configuring a StructureMap Container.
public class MyRegistry : Registry
{
public MyRegistry()
{
ForRequestedType(typeof(IService)).TheDefaultIsConcreteType(typeof(Service));
}
}
You can overide this method as a place to put the Registry DSL
declarations. This is not mandatory.
Expression Builder used to define policies for a PluginType including
Scoping, the Default Instance, and interception. BuildInstancesOf()
and ForRequestedType() are synonyms
Expression Builder used to define policies for a PluginType including
Scoping, the Default Instance, and interception. This method is specifically
meant for registering open generic types
This method is a shortcut for specifying the default constructor and
setter arguments for a ConcreteType. ForConcreteType is shorthand for:
ForRequestedType[T]().TheDefault.Is.OfConcreteType[T].**************
when the PluginType and ConcreteType are the same Type
Expression Builder used to define policies for a PluginType including
Scoping, the Default Instance, and interception. BuildInstancesOf()
and ForRequestedType() are synonyms
Convenience method. Equivalent of ForRequestedType[PluginType]().AsSingletons()
Uses the configuration expressions of this Registry to create a PluginGraph
object that could be used to initialize a Container. This method is
mostly for internal usage, but might be helpful for diagnostics
Adds an additional, non-Default Instance to the PluginType T.
Adds an additional, non-Default Instance to the designated pluginType
This method is mostly meant for open generic types
Expression Builder to define the defaults for a named Profile. Each call
to CreateProfile is additive.
An alternative way to use CreateProfile that uses ProfileExpression
as a Nested Closure. This usage will result in cleaner code for
multiple declarations
Registers a new TypeInterceptor object with the Container
Allows you to define a TypeInterceptor inline with Lambdas or anonymous delegates
IfTypeMatches( ... ).InterceptWith( o => new ObjectWrapper(o) );
Designates a policy for scanning assemblies to auto
register types
Directs StructureMap to always inject dependencies into any and all public Setter properties
of the type PLUGINTYPE.
Creates automatic "policies" for which public setters are considered mandatory
properties by StructureMap that will be "setter injected" as part of the
construction process.
Use to programmatically select the constructor function of a concrete
class. Applies globally to all Containers in a single AppDomain.
Syntactic Sugar for saying ForRequestedType().TheDefault.IsThis( @object )
Syntactic Sugar for saying ForRequestedType().TheDefault.IsThis( instance )
Shorthand for ForRequestedType(pluginType)
Define the constructor and setter arguments for the default T
Emits the IL for the InstanceBuilder.BuildInstance(InstanceMemento) method of an
InstanceBuilder
Emits the IL for one method
Emits the IL for a new class Type
Helper class to use to create a dynamically emitted assembly
Manages the IL emitting of a dynamic assembly of InstanceBuilder classes
Gets a class name for the InstanceBuilder that will be emitted for this Plugin
Implementation of ParameterEmitter for a constructor argument like
MyClass(IStrategy[] strategies)
Abstract class to provide a template for emitting the instructions for retrieving
one constructor function argument from an InstanceMemento and feeding into the
constructor function
Implementation of ParameterEmitter for a non-primitive, non-array
constructor argument
Implementation of ParameterEmitter for enumeration types
Implementation of ParameterEmitter for primitive types other than strings.
Implementation of ParameterEmitter for string type constructor arguments
Thrown by IProperty classes when an invalid value is applied to
a property of an InstanceGraph
Main exception for StructureMap. Use the ErrorCode to aid in troubleshooting
StructureMap problems
Represents a concrete class that can be built by StructureMap as an instance of the parent
PluginFamily’s PluginType. The properties of a Plugin are the CLR Type of the concrete class,
and the human-friendly concrete key that StructureMap will use to identify the Type.
The ConcreteKey that identifies the Plugin within a PluginFamily
The concrete CLR Type represented by the Plugin
Property's that will be filled by setter injection
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.
The CLR Type that defines the "Plugin" interface for the PluginFamily
The InstanceKey of the default instance of the PluginFamily
Custom collection class for PluginFamily's
Adds the concreteType as an Instance of the pluginType
Adds the concreteType as an Instance of the pluginType with a name
Add the pluggedType as an instance to any configured pluginType where pluggedType
could be assigned to the pluginType
Models the runtime configuration of a StructureMap Container
Closes the PluginGraph for adding or removing members. Runs all the AssemblyScanner's
and attempts to attach concrete types to the proper plugin types. Calculates the Profile defaults.
Adds an AssemblyScanner to the PluginGraph. Used for Testing.
Adds the concreteType as an Instance of the pluginType
Adds the concreteType as an Instance of the pluginType with a name
Add the pluggedType as an instance to any configured pluginType where pluggedType
could be assigned to the pluginType
Add configuration to a PluginGraph with the Registry DSL
Designates whether a PluginGraph has been "Sealed."
Represents a PropertyInfo of a Plugin.PluggedType that is filled by Setter Injection
Custom collection class for SetterProperty objects
Designates a CLR type that is loaded by name.
Interface for a "Factory" pattern class that creates object instances of the PluginType
The main "container" object that implements the Service Locator pattern
Creates or finds the named instance of the pluginType
Creates or finds the default instance of the pluginType
Creates a new instance of the requested type using the supplied Instance. Mostly used internally
Creates or finds the named instance of T
Creates or finds the default instance of type T
Creates a new instance of the requested type T using the supplied Instance. Mostly used internally
Creates or resolves all registered instances of type T
Creates or resolves all registered instances of the pluginType
Creates or finds the named instance of the pluginType. Returns null if the named instance is not known to the container.
Creates or finds the default instance of the pluginType. Returns null if the pluginType is not known to the container.
Creates or finds the default instance of type T. Returns the default value of T if it is not known to the container.
Creates or finds the named instance of type T. Returns the default value of T if the named instance is not known to the container.
Used to add additional configuration to a Container *after* the initialization.
Injects the given object into a Container as the default for the designated
PLUGINTYPE. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Injects the given object into a Container as the default for the designated
pluginType. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Injects the given object into a Container by name for the designated
pluginType. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Sets the default instance for all PluginType's to the designated Profile.
Returns a report detailing the complete configuration of all PluginTypes and Instances
Use with caution! Does a full environment test of the configuration of this container. Will try to create every configured
instance and afterward calls any methods marked with the [ValidationMethod] attribute
Gets all configured instances of type T using explicitly configured arguments from the "args"
Gets the default instance of type T using the explicitly configured arguments from the "args"
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency
of type T should be "arg"
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency or primitive argument
with the designated name should be the next value.
Gets the default instance of the pluginType using the explicitly configured arguments from the "args"
Removes all configured instances of type T from the Container. Use with caution!
The "BuildUp" method takes in an already constructed object
and uses Setter Injection to push in configured dependencies
of that object
Convenience method to request an object using an Open Generic
Type and its parameter Types
IFlattener flattener1 = container.ForGenericType(typeof (IFlattener<>))
.WithParameters(typeof (Address)).GetInstanceAs<IFlattener>();
Gets the named instance of the pluginType using the explicitly configured arguments from the "args"
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency
of type T should be "arg"
Starts a "Nested" Container for atomic, isolated access
Starts a new "Nested" Container for atomic, isolated service location. Opens
Provides queryable access to the configured PluginType's and Instances of this Container
Base class for creating an object instance from an InstanceMemento. SubClasses are
emitted for each concrete Plugin with constructor parameters.
Default implementation of IInstanceFactory
Constructor to use when troubleshooting possible configuration issues.
Constructor to create an Container
PluginGraph containing the instance and type definitions
for the Container
Creates or finds the named instance of T
Creates a new instance of the requested type T using the supplied Instance. Mostly used internally
Gets the default instance of the pluginType using the explicitly configured arguments from the "args"
Gets the default instance of the pluginType using the explicitly configured arguments from the "args"
Gets all configured instances of type T using explicitly configured arguments from the "args"
Creates or finds the default instance of type T
Creates or resolves all registered instances of type T
Sets the default instance for all PluginType's to the designated Profile.
Creates or finds the named instance of the pluginType
Creates or finds the named instance of the pluginType. Returns null if the named instance is not known to the container.
Creates or finds the default instance of the pluginType. Returns null if the pluginType is not known to the container.
Creates or finds the default instance of type T. Returns the default value of T if it is not known to the container.
The "BuildUp" method takes in an already constructed object
and uses Setter Injection to push in configured dependencies
of that object
Creates or finds the named instance of type T. Returns the default value of T if the named instance is not known to the container.
Creates or finds the default instance of the pluginType
Creates a new instance of the requested type using the supplied Instance. Mostly used internally
Creates or resolves all registered instances of the pluginType
Used to add additional configuration to a Container *after* the initialization.
Returns a report detailing the complete configuration of all PluginTypes and Instances
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency
of type T should be "arg"
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency
of type T should be "arg"
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency or primitive argument
with the designated name should be the next value.
Use with caution! Does a full environment test of the configuration of this container. Will try to create every configured
instance and afterward calls any methods marked with the [ValidationMethod] attribute
Removes all configured instances of type T from the Container. Use with caution!
Convenience method to request an object using an Open Generic
Type and its parameter Types
IFlattener flattener1 = container.ForGenericType(typeof (IFlattener<>))
.WithParameters(typeof (Address)).GetInstanceAs<IFlattener>();
Starts a "Nested" Container for atomic, isolated access
Starts a new "Nested" Container for atomic, isolated service location. Opens
Injects the given object into a Container by name for the designated
pluginType. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Sets the default instance for the PluginType
Injects the given object into a Container as the default for the designated
pluginType. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Injects the given object into a Container as the default for the designated
PLUGINTYPE. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Provides queryable access to the configured PluginType's and Instances of this Container
GoF Memento representing an Object Instance
Retrieves the named property value as a string
Template method for implementation specific retrieval of the named property
Returns the named child InstanceMemento
Template method for implementation specific retrieval of the named property
This method is made public for testing. It is not necessary for normal usage.
Used to create a templated InstanceMemento
The named type of the object instance represented by the InstanceMemento. Translates to a concrete
type
The named key of the object instance represented by the InstanceMemento
Gets the referred template name
Template pattern property specifying whether the InstanceMemento is simply a reference
to another named instance. Useful for child objects.
Template pattern property specifying the instance key that the InstanceMemento refers to
Is the InstanceMemento a reference to the default instance of the plugin type?
A TypeInterceptor that always applies to all Instances of a given Plugin Type
Abstract class that is the supertype of all storage and retrieval mechanisms of
InstanceMemento instances
Retrieves the named InstanceMemento
The instanceKey of the requested InstanceMemento
Retrieves an array of all InstanceMemento's stored by this MementoSource
Template pattern method. Determines if the MementoSource contains a definition for the
requested instanceKey.
Template pattern method. Retrieves an InstanceMemento for the instanceKey
The type of MementoSource
String description of the MementoSource. Used in the StructureMap-Client UI.
An in-memory implementation of InstanceMemento.
Creates an instance of MemoryInstanceMemento that represents a reference to another
instance.
The referenced instance key to another instance
Creates a MemoryInstanceMemento that represents a reference to the default instance
of a plugin type.
Constructs a MemoryInstanceMemento without properties
The concrete key of the plugin type
The identifying instance key
Constructs a MemoryInstanceMemento with properties
The concrete key of the plugin type
The identifying instance key
NameValueCollection of instance properties
Sets the value of the named property
Deletes a named property from the DefaultInstanceMemento
Links a child InstanceMemento as a named property
Links an array of InstanceMemento's to a named array property
See InstanceMemento
See InstanceMemento
See InstanceMemento
See InstanceMemento
See InstanceMemento
The main static Facade for the StructureMap container
Restarts ObjectFactory and blows away all Singleton's and cached instances. Use with caution.
Injects the given object into a Container as the default for the designated
pluginType. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Injects the given object into a Container as the default for the designated
PLUGINTYPE. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Injects the given object into a Container by name for the designated
pluginType. Mostly used for temporarily setting up return values of the Container
to introduce mocks or stubs during automated testing scenarios
Returns a report detailing the complete configuration of all PluginTypes and Instances
Use with caution! Does a full environment test of the configuration of this container. Will try to create every configured
instance and afterward calls any methods marked with the [ValidationMethod] attribute
Creates or finds the default instance of the pluginType
Creates or finds the default instance of type T
Creates a new instance of the requested type using the supplied Instance. Mostly used internally
Creates a new instance of the requested type T using the supplied Instance. Mostly used internally
Creates or finds the named instance of the pluginType
Creates or finds the named instance of T
Creates or resolves all registered instances of the pluginType
Creates or resolves all registered instances of type T
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency
of type T should be "arg"
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency or primitive argument
with the designated name should be the next value.
Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency
of type T should be "arg"
Removes all configured instances of type T from the Container. Use with caution!
Used to add additional configuration to a Container *after* the initialization.
Creates or finds the named instance of the pluginType. Returns null if the named instance is not known to the container.
Creates or finds the default instance of the pluginType. Returns null if the pluginType is not known to the container.
Creates or finds the default instance of type T. Returns the default value of T if it is not known to the container.
Creates or finds the named instance of type T. Returns the default value of T if the named instance is not known to the container.
The "BuildUp" method takes in an already constructed object
and uses Setter Injection to push in configured dependencies
of that object
Convenience method to request an object using an Open Generic
Type and its parameter Types
IFlattener flattener1 = container.ForGenericType(typeof (IFlattener<>))
.WithParameters(typeof (Address)).GetInstanceAs<IFlattener>();
Provides queryable access to the configured PluginType's and Instances of the inner Container
Sets the default instance for all PluginType's to the designated Profile.
Reads configuration XML documents and builds the structures necessary to initialize
the Container/IInstanceFactory/InstanceBuilder/ObjectInstanceActivator objects
Reads the configuration information and returns the PluginGraph definition of
plugin families and plugin's
Generic implementation of an XmlMementoSource
Base class for all MementoSource classes that store InstanceMemento's as
node-normalized Xml
Implementation of MementoSource that stores and retrieves an XmlInstanceMemento per file in a named directory.
DirectoryXmlMementoSource is meant to simplify complicated object graph configurations by isolating each instance to a separate
editable file.
Stores an Xml InstanceMemento per file in a directory
A ";" delimited list of directories to look for mementos. DirectoryXmlMementoSource
will use the FIRST directory it finds
The file extension of the InstanceMemento files without a dot. Typically "xml"
NodeNormalized or AttributeNormalized
Implementation of MementoSource that stores and retrieves an XmlInstanceMemento per Embedded Resource file
in a named namespace. EmbeddedFolderXmlMementoSource is meant to simplify complicated object graph configurations
by isolating each instance to a separate
editable file.
NodeNormalized or AttributeNormalized
The name of the Assembly with the embedded resources
The root namespace of all of the mementos.
The file extension of the memento files - "xml"
An in-memory MementoSource
Retrieves Xml InstanceMemento's from an xml file stored as an embedded resource in an assembly.
Designates the nodes that are memento nodes
NodeNormalized or AttributeNormalized
The name of the Assembly the file is embedded into
The path to the embedded resource within the file
Default Constructor
MementoSource that contains the Memento Templates
MementoSource that contains instances consisting of Template valuee
Stores Attribute-normalized InstanceMemento's in an external file
Implementation of XmlMementoSource that reads InstanceMemento's from an external file.
Useful to break the StructureMap.config file into smaller pieces.
Default constructor
Path to the xml file that contains the instance configuration
XPath expression to the parent node that contains the InstanceMemento nodes.
If empty, it defaults to the top node
The name of the nodes that are InstanceMemento nodes. Useful to store
different types of instances in the same file
An implementation of InstanceMemento that stores properties as Xml attributes
Limited functionality
Implementation of InstanceMemento that stores information in a node-normalized
Xml format.
Programmatically adds a <StructureMap> node containing Xml configuration
A description of this node source for troubleshooting purposes
Returns the path to the StructureMap.config file
Clears StructureMapConfiguration of all configuration options. Returns StructureMap
to only using the default StructureMap.config file for configuration.
Builds a PluginGraph object for the current configuration. Used by ObjectFactory.
Directs StructureMap to include Xml configuration information from a separate file
Programmatically determine Assembly's to be scanned for attribute configuration
Direct StructureMap to create instances of Type T
The Type to build
Direct StructureMap to create instances of Type T
The Type to build
Starts the definition of a configuration Profile.
Directs StructureMap to use a Registry class to construct the
PluginGraph
Flag to enable or disable the usage of the default StructureMap.config
If set to false, StructureMap will not look for a StructureMap.config file
Specify the open generic type that should have a single generic parameter
specify what type you'd like the service returned as
Used as the argument in the Container.Configure() method to describe
configuration directives and specify the sources of configuration for
a Container
Creates and adds a Registry object of type T.
The Registry Type
Imports all the configuration from a Registry object
Imports configuration from an Xml file. The fileName
must point to an Xml file with valid StructureMap
configuration
Imports configuration directly from an XmlNode. This
method was intended for scenarios like Xml being embedded
into an assembly. The node must be a 'StructureMap' node
If true, directs StructureMap to look for configuration in the App.config.
The default value is false.
Expression Builder to define an Instance
Register a previously built Instance. This provides a "catch all"
method to attach custom Instance objects. Synonym for Instance()
Inject this object directly. Synonym to Object()
Gives you full access to all the different ways to specify an "Instance"
An Expression Builder to define Instances of a PluginType.
This is mostly used for configuring open generic types
Shortcut to register a Concrete Type as an instance. This method supports
method chaining to allow you to add constructor and setter arguments for
the concrete type
Shortcut to simply use the Instance with the given name
An Expression Builder that is used throughout the Registry DSL to
add and define Instances
Register a previously built Instance. This provides a "catch all"
method to attach custom Instance objects. Synonym for IsThis()
Inject this object directly. Synonym to IsThis()
Build the Instance with the constructor function and setter arguments. Starts
the definition of a SmartInstance
Build the Instance with the constructor function and setter arguments. Use this
method for open generic types, and favor the generic version of OfConcreteType
for all other types
Create an Instance that builds an object by calling a Lambda or
an anonymous delegate with no arguments
Create an Instance that builds an object by calling a Lambda or
an anonymous delegate with the IContext representing
the current object graph.
Use the Instance of this PluginType with the specified name. This is
generally only used while configuring child dependencies within a deep
object graph
Use the default Instance of this PluginType. This is
generally only used while configuring child dependencies within a deep
object graph
Creates an Instance that stores this object of type T,
and returns a cloned copy of the template.
Caches template as a serialized byte stream. Uses deserialization
to create copies when the Instance is built.
Creates an Instance that will load an ASCX user control from the url
Creates an Instance according to conditional rules
Used as an expression builder to specify setter injection policies
Directs StructureMap to treat all public setters of type T as
mandatory properties
Directs StructureMap to tread all public setters with
a PropertyType that matches the predicate as a
mandatory setter
Directs StructureMap to treat all public setters that match the
rule as mandatory properties
Directs StructureMap to treat all public setters with a property
type in the specified namespace as mandatory properties
Directs StructureMap to treat all public setters with a property
type in the specified namespace as mandatory properties
Directs StructureMap to treat all public setters where to property name
matches the specified rule as a mandatory property
Makes sure that every request for this object returns a unique object
Imports configuration from an Xml file. The fileName
must point to an Xml file with valid StructureMap
configuration
Imports configuration directly from an XmlNode. This
method was intended for scenarios like Xml being embedded
into an assembly. The node must be a 'StructureMap' node
Creates and adds a Registry object of type T.
The Registry Type
Imports all the configuration from a Registry object
Expression Builder used to define policies for a PluginType including
Scoping, the Default Instance, and interception. BuildInstancesOf()
and ForRequestedType() are synonyms
Expression Builder used to define policies for a PluginType including
Scoping, the Default Instance, and interception. BuildInstancesOf()
and ForRequestedType() are synonyms
Expression Builder used to define policies for a PluginType including
Scoping, the Default Instance, and interception. This method is specifically
meant for registering open generic types
This method is a shortcut for specifying the default constructor and
setter arguments for a ConcreteType. ForConcreteType is shorthand for:
ForRequestedType[T]().TheDefault.Is.OfConcreteType[T].**************
when the PluginType and ConcreteType are the same Type
Adds an additional, non-Default Instance to the PluginType T.
Adds an additional, non-Default Instance to the designated pluginType
This method is mostly meant for open generic types
Expression Builder to define the defaults for a named Profile. Each call
to CreateProfile is additive.
An alternative way to use CreateProfile that uses ProfileExpression
as a Nested Closure. This usage will result in cleaner code for
multiple declarations
Registers a new TypeInterceptor object with the Container
Allows you to define a TypeInterceptor inline with Lambdas or anonymous delegates
IfTypeMatches( ... ).InterceptWith( o => new ObjectWrapper(o) );
Expresses a single "Scanning" action
Scan(x => {
x.Assembly("Foo.Services");
x.WithDefaultConventions();
});
Directs StructureMap to always inject dependencies into any and all public Setter properties
of the type PLUGINTYPE.
Creates automatic "policies" for which public setters are considered mandatory
properties by StructureMap that will be "setter injected" as part of the
construction process.
If true, makes the existence of the StructureMap.config mandatory.
The default is false.
If true, the StructureMap.config file will be ignored even if it exists.
The default is false.
If true, directs StructureMap to look for configuration in the App.config.
The default value is false.
Designate the Default Profile. This will be applied as soon as the
Container is initialized.
Models the state of a Container or ObjectFactory. Can be used to query for the
existence of types registered with StructureMap
Can StructureMap fulfill a request to ObjectFactory.GetInstance(pluginType) from the
current configuration. This does not include concrete classes that could be auto-configured
upon demand
Can StructureMap fulfill a request to ObjectFactory.GetInstance<T>() from the
current configuration. This does not include concrete classes that could be auto-configured
upon demand
Queryable access to all of the IInstance for a given PluginType
Queryable access to all of the IInstance for a given PluginType
Does the current container have existing configuration for the "pluginType"
Does the current container have existing configuration for the type T
Access to all the Plugin Type registrations
The requested PluginType of the Instance being create
The Name of the Instance being created
The actual ConcreteType being created. This will not always
be available
Models the current place in an object graph during the construction of
an instance. Provides contextual information that can be used
to alter the desired construction of child objects
The requested PluginType of the Instance being create
The Name of the Instance being created
The actual ConcreteType being created. This will not always
be available
Provides metadata about the object graph being constructed. More or less a stack trace of the GetInstance() pipeline
that can be used for "contextual" object construction
The top level of the object graph. Describes the original requested instance
The current BuildFrame
The immediate parent BuildFrame
Defines the value of a primitive argument to a constructur argument
Sets the value of the constructor argument
Sets the value of the constructor argument to the key/value in the
AppSettings
The key in appSettings for the value to use.
Sets the value of the constructor argument to the key/value in the
AppSettings when it exists. Otherwise uses the provided default value.
The key in appSettings for the value to use.
The value to use if an entry for does not exist in the appSettings section.
Instance that builds objects with by calling constructor functions and using setter properties
The concrete type constructed by SmartInstance
Sets the name of this Instance
Register an Action to perform on the object created by this Instance
before it is returned to the caller
Register an Action to perform on the object created by this Instance
before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Register a Func to potentially enrich or substitute for the object
created by this Instance before it is returned to the caller
Register an InstanceInterceptor with this Instance
Define a primitive constructor argument
Set simple setter properties
Define a primitive setter property by specifying the property name with
an expression
Define a primitive setter property by specifying the property name
Inline definition of a constructor dependency. Select the constructor argument by type. Do not
use this method if there is more than one constructor arguments of the same type
Inline definition of a constructor dependency. Select the constructor argument by type and constructor name.
Use this method if there is more than one constructor arguments of the same type
Inline definition of a setter dependency. The property name is specified with an Expression
Inline definition of a setter dependency. Only use this method if there
is only a single property of the SETTERTYPE
Inline definition of a dependency on an Array of the CHILD type. I.e. CHILD[].
This method can be used for either constructor arguments or setter properties
Inline definition of a dependency on an Array of the CHILD type and the specified setter property or constructor argument name. I.e. CHILD[].
This method can be used for either constructor arguments or setter properties
Expression Builder to help define multiple Instances for an Array dependency
Nested Closure that allows you to add an unlimited number of child Instances
Specify an array of Instance objects directly for an Array dependency
Expression Builder that helps to define child dependencies inline
Nested Closure to define a child dependency inline
Shortcut to set an inline dependency to an Instance
Shortcut to set an inline dependency to a designated object
Set an Inline dependency to the Default Instance of the Property type
Used mostly to force an optional Setter property to be filled by
StructureMap
Shortcut method to define a child dependency inline
Metadata describing the registration of a PluginType
The "instance" that will be used when Container.GetInstance(PluginType) is called.
See IInstance for more information
The build "policy" for this PluginType. Used by the WhatDoIHave() diagnostics methods
All of the IInstance's registered
for this PluginType
Provides virtual methods that can be used by subclasses to parse an expression tree.
This class actually already exists in the System.Core assembly...as an internal class.
I can only speculate as to why it is internal, but it is obviously much too dangerous
for anyone outside of Microsoft to be using...