User: xtoff
Date: 2010/02/22 12:07 PM
Modified:
/InversionOfControl/trunk/src/
BreakingChanges.txt, Changes.txt
/InversionOfControl/trunk/src/Castle.MicroKernel/Registration/Strategies/
BasedOnDescriptor.cs
Log:
- 'If' and 'Unless' methods on fluent registration API are now cumulative - it
is legal to call them multiple times and all conditions will be checked. This
is a minor breaking change from previous behavior where last call would win.
File Changes:
Directory:
/InversionOfControl/trunk/src/Castle.MicroKernel/Registration/Strategies/
====================================================================================
File [modified]: BasedOnDescriptor.cs
Delta lines: +11 -0
===================================================================
--- InversionOfControl/trunk/src/Changes.txt 2010-02-22 07:28:30 UTC (rev
6756)
+++ InversionOfControl/trunk/src/Changes.txt 2010-02-22 19:07:42 UTC (rev
6757)
@@ -1,6 +1,17 @@
unreleased changes
==================
+- If and Unless functions on fluent registration API are now cumulative - it
is legal to call them multiple times and all conditions will be checked. This
is a minor breaking change from previous behavior where last call would win.
+- added typed arguments (specified by type rather than by name).
+ It works for:
+ - call site (Resolve with Dictionary, specifying System.Type as value
of key. A helper class 'Arguments' should be used for this.)
+ - DynamicParameters - there's an extension method Insert that should
make using it nicer
+ - fluent Api (DependsOn(Property.ForKey<string>().Eq("typed"))
+
+- added 'Insert' extension method on IDictionary, specifically so simplify
usage in DynamicParameters method and similar situations. It behaves like
IDictionary's indexer setter
+
+- added 'Arguments' class to carry inline arguments (typed or named) for
components. It is recommended to use this class rather than Hashtable or
Dictionary<>
+
- added strongly typed overloads for StartUsingMethod and StopUsingMethod from
startable facility's registration API. It is now possible to call
.StartUsingMethod(x => x.Start).StopUsingMethod(x => x.Stop)
Directory: /InversionOfControl/trunk/src/
=========================================
File [modified]: BreakingChanges.txt
Delta lines: +6 -6
===================================================================
---
InversionOfControl/trunk/src/Castle.MicroKernel/Registration/Strategies/BasedOnDescriptor.cs
2010-02-22 07:28:30 UTC (rev 6756)
+++
InversionOfControl/trunk/src/Castle.MicroKernel/Registration/Strategies/BasedOnDescriptor.cs
2010-02-22 19:07:42 UTC (rev 6757)
@@ -32,7 +32,7 @@
private readonly Type basedOn;
private readonly FromDescriptor from;
private readonly ServiceDescriptor service;
- private List<ConfigureDescriptor> configurers;
+ private readonly List<ConfigureDescriptor> configurers;
private Predicate<Type> unlessFilter;
private Predicate<Type> ifFilter;
@@ -62,7 +62,7 @@
/// <returns></returns>
public BasedOnDescriptor If(Predicate<Type> ifFilter)
{
- this.ifFilter = ifFilter;
+ this.ifFilter += ifFilter;
return this;
}
@@ -73,7 +73,7 @@
/// <returns></returns>
public BasedOnDescriptor Unless(Predicate<Type> unlessFilter)
{
- this.unlessFilter = unlessFilter;
+ this.unlessFilter += unlessFilter;
return this;
}
@@ -104,9 +104,9 @@
/// <returns></returns>
public BasedOnDescriptor Configure(ConfigureDelegate configurer)
{
- return Configure(delegate(ComponentRegistration
registration)
+ return Configure(delegate(ComponentRegistration
registration)
{
- configurer(registration);
+ configurer(registration);
});
}
@@ -119,7 +119,7 @@
/// <returns></returns>
public BasedOnDescriptor
ConfigureFor<T>(Action<ComponentRegistration> configurer)
{
- ConfigureDescriptor config = new
ConfigureDescriptor(this, typeof(T), configurer);
+ var config = new ConfigureDescriptor(this, typeof(T),
configurer);
configurers.Add(config);
return this;
File [modified]: Changes.txt
Delta lines: +0 -0
===================================================================
--
You received this message because you are subscribed to the Google Groups
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-commits?hl=en.