SingletonDependencyObjectTInterfaceSet Method |
Creates a new singleton.
If there is a existing instance for the type and rewriting is not allowed the new mapping will not be set
Throws exception if mapping is not allowed and
ThrowErrorOnDeniedMapping is true
Namespace:
Crosser.Resolve.Model
Assembly:
Crosser.Resolver (in Crosser.Resolver.dll) Version: 0.0.9.1
Syntax public bool Set(
Expression<Func<TInterface>> creator,
bool rewritable = false,
bool enabled = true,
IDictionary<string, Object> properties = null
)
Parameters
- creator
- Type: System.Linq.ExpressionsExpressionFuncTInterface
The expression that will generate the type of TInterface - rewritable (Optional)
- Type: SystemBoolean
True if this expression can be overwritten with a new expression, default is false - enabled (Optional)
- Type: SystemBoolean
If false you cant get an instance of the dependency, default true - properties (Optional)
- Type: System.Collections.GenericIDictionaryString, Object
key/value storage for properties attached to this dependency, default null
Return Value
Type:
Booleantrue if the mapping was ok, otherwise false
See Also