From: <jer...@us...> - 2010-02-04 02:37:03
|
Revision: 329 http://structuremap.svn.sourceforge.net/structuremap/?rev=329&view=rev Author: jeremydmiller Date: 2010-02-04 00:33:40 +0000 (Thu, 04 Feb 2010) Log Message: ----------- Pulling back some code for 3.0 to make a temporary bug release Modified Paths: -------------- trunk/Source/HTML/AutoWiring.htm trunk/Source/HTML/ConfiguringStructureMap.htm trunk/Source/HTML/Generics.htm trunk/Source/HTML/InstanceExpression.htm trunk/Source/HTML/Interception.htm trunk/Source/HTML/QuickStart.htm trunk/Source/HTML/RegistryDSL.htm trunk/Source/HTML/ScanningAssemblies.htm trunk/Source/HTML/UsingTheContainerOutsideOfObjectFactory.htm trunk/Source/StructureMap/BuildSession.cs trunk/Source/StructureMap/Configuration/DSL/Expressions/CreatePluginFamilyExpression.cs trunk/Source/StructureMap/Configuration/DSL/IRegistry.cs trunk/Source/StructureMap/Configuration/DSL/Registry.cs trunk/Source/StructureMap/Container.cs trunk/Source/StructureMap/IContainer.cs trunk/Source/StructureMap/Pipeline/SmartInstance.cs trunk/Source/StructureMap/PipelineGraph.cs trunk/Source/StructureMap/StructureMap.csproj trunk/Source/StructureMap/StructureMapException.resx trunk/Source/StructureMap/SystemRegistry.cs trunk/Source/StructureMap.DebuggerVisualizers.Testing/Program.cs trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs trunk/Source/StructureMap.Testing/AutoWiringExamples.cs trunk/Source/StructureMap.Testing/BidirectionalDependencies.cs trunk/Source/StructureMap.Testing/Bugs/FillAllPropertiesShouldWorkForAlreadyConfiguredPluginsBug.cs trunk/Source/StructureMap.Testing/Bugs/HttpSessionNullRefBug.cs trunk/Source/StructureMap.Testing/Bugs/LambdaCreatesNullBugTester.cs trunk/Source/StructureMap.Testing/Bugs/MixedConfigureAndInitializeMissingInstanceProblem.cs trunk/Source/StructureMap.Testing/Bugs/SingletonShouldBeLazy.cs trunk/Source/StructureMap.Testing/Bugs/SpecifyScopeInConfigureTester.cs trunk/Source/StructureMap.Testing/BuildSessionTester.cs trunk/Source/StructureMap.Testing/BuildUpIntegratedTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/AddInstanceTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/AddTypesTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/ConstructorExpressionTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/CreatePluginFamilyTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/GenericFamilyExpressionTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/InjectArrayTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/InterceptAllInstancesOfPluginTypeTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/InterceptorTesting.cs trunk/Source/StructureMap.Testing/Configuration/DSL/ProfileExpressionTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/RegistryTester.cs trunk/Source/StructureMap.Testing/Diagnostics/DoctorTester.cs trunk/Source/StructureMap.Testing/Diagnostics/ValidationBuildSessionTester.cs trunk/Source/StructureMap.Testing/Examples/CustomInstance.cs trunk/Source/StructureMap.Testing/Examples/Interception.cs trunk/Source/StructureMap.Testing/Examples/RegisteringWithTheAPI.cs trunk/Source/StructureMap.Testing/Examples.cs trunk/Source/StructureMap.Testing/GenericsAcceptanceTester.cs trunk/Source/StructureMap.Testing/Graph/ArrayConstructorTester.cs trunk/Source/StructureMap.Testing/Graph/AssemblyScannerTester.cs trunk/Source/StructureMap.Testing/Graph/ContainerTester.cs trunk/Source/StructureMap.Testing/Graph/ConventionBasedSetterInjectionTester.cs trunk/Source/StructureMap.Testing/Graph/DynamicInjectionTester.cs trunk/Source/StructureMap.Testing/Graph/FillDependenciesTester.cs trunk/Source/StructureMap.Testing/Graph/FullStackFacadeTester.cs trunk/Source/StructureMap.Testing/Graph/GenericsPluginGraphTester.cs trunk/Source/StructureMap.Testing/Graph/InstanceFactoryTester.cs trunk/Source/StructureMap.Testing/Graph/IntegratedTester.cs trunk/Source/StructureMap.Testing/Graph/Interceptors/TypeInterceptionTester.cs trunk/Source/StructureMap.Testing/Graph/PluginGraphBuilderTester.cs trunk/Source/StructureMap.Testing/Graph/PluginTester.cs trunk/Source/StructureMap.Testing/Graph/TestExplicitArguments.cs trunk/Source/StructureMap.Testing/Graph/TypeFindingTester.cs trunk/Source/StructureMap.Testing/ModelQueryTester.cs trunk/Source/StructureMap.Testing/ObjectFactoryTester.cs trunk/Source/StructureMap.Testing/PerRequestInterceptorTester.cs trunk/Source/StructureMap.Testing/Pipeline/BuildStrategiesTester.cs trunk/Source/StructureMap.Testing/Pipeline/ConditionalInstanceTester.cs trunk/Source/StructureMap.Testing/Pipeline/ConfiguredInstanceTester.cs trunk/Source/StructureMap.Testing/Pipeline/GenericsHelperExpressionTester.cs trunk/Source/StructureMap.Testing/Pipeline/HybridBuildLifecycleTester.cs trunk/Source/StructureMap.Testing/Pipeline/MissingInstanceTester.cs trunk/Source/StructureMap.Testing/Pipeline/NestedContainerSupportTester.cs trunk/Source/StructureMap.Testing/Pipeline/ObjectBuilderTester.cs trunk/Source/StructureMap.Testing/Pipeline/OptionalSetterInjectionTester.cs trunk/Source/StructureMap.Testing/Pipeline/SmartInstanceTester.cs trunk/Source/StructureMap.Testing/Pipeline/ThreadLocalStorageLifecycleTester.cs trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj trunk/Source/StructureMap.Testing/StructureMapConfigurationTester.cs trunk/cruise.build Removed Paths: ------------- trunk/Source/StructureMap/Pipeline/BasicInstance.cs trunk/Source/StructureMap.Testing/Configuration/DSL/DeepInstanceTester.cs Modified: trunk/Source/HTML/AutoWiring.htm =================================================================== --- trunk/Source/HTML/AutoWiring.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/AutoWiring.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -150,7 +150,7 @@ <span style="COLOR: green">// Set up the IRepository</span></p> <p style="MARGIN: 0px"> - x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().Use<<span style="COLOR: #2b91af">Repository</span>>()</p> <p style="MARGIN: 0px"> Modified: trunk/Source/HTML/ConfiguringStructureMap.htm =================================================================== --- trunk/Source/HTML/ConfiguringStructureMap.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/ConfiguringStructureMap.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -142,7 +142,7 @@ these methods for all all the possible configuration directives.</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red0\green128\blue0;}??\fs20 \cf3 public\cf0 \cf3 interface\cf0 \cf4 IInitializationExpression\par ??\cf0 \{\par ?? \cf5 // Directives on how to treat the StructureMap.config file\par ??\cf0 \cf3 bool\cf0 UseDefaultStructureMapConfigFile \{ \cf3 set\cf0 ; \}\par ?? \cf3 bool\cf0 IgnoreStructureMapConfig \{ \cf3 set\cf0 ; \}\par ??\par ?? \cf5 // Xml configuration from the App.Config file\par ??\cf0 \cf3 bool\cf0 PullConfigurationFromAppConfig \{ \cf3 set\cf0 ; \}\par ??\par ?? \cf5 // Ancillary sources of Xml configuration\par ??\cf0 \cf3 void\cf0 AddConfigurationFromXmlFile(\cf3 string\cf0 fileName);\par ?? \cf3 void\cf0 AddConfigurationFromNode(\cf4 XmlNode\cf0 node);\par ??\par ?? \cf5 // Specifying Registry's\par ??\cf0 \cf3 void\cf0 AddRegistry<T>() \cf3 where\cf0 T : \cf4 Registry\cf0 , \cf3 new\cf0 ();\par ?? \cf3 void\cf0 AddRegistry(\cf4 Registry\cf0 registry);\par ??\par ?? \cf5 // Designate the Default Profile. This will be applied as soon as the \par ??\cf0 \cf5 // Container is initialized.\par ??\cf0 \cf3 string\cf0 DefaultProfileName \{ \cf3 get\cf0 ; \cf3 set\cf0 ; \}\par ??\par ?? \cf5 // ... and the Registry DSL as well\par ??\par ??\cf0 \cf5 // The Registry DSL\par ??\cf0 \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> BuildInstancesOf<PLUGINTYPE>();\par ?? \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> ForRequestedType<PLUGINTYPE>();\par ?? \cf4 GenericFamilyExpression\cf0 For(\cf4 Type\cf0 pluginType);\par ?? \cf4 Registry\cf0 .\cf4 BuildWithExpression\cf0 <T> ForConcreteType<T>();\par ??\par ?? \cf4 IsExpression\cf0 <T> InstanceOf<T>();\par ?? \cf4 GenericIsExpression\cf0 InstanceOf(\cf4 Type\cf0 pluginType);\par ??\par ?? \cf4 ProfileExpression\cf0 CreateProfile(\cf3 string\cf0 profileName);\par ?? \cf3 void\cf0 CreateProfile(\cf3 string\cf0 profileName, \cf4 Action\cf0 <\cf4 ProfileExpression\cf0 > action);\par ??\par ?? \cf3 void\cf0 RegisterInterceptor(\cf4 TypeInterceptor\cf0 interceptor);\par ?? \cf4 MatchedTypeInterceptor\cf0 IfTypeMatches(\cf4 Predicate\cf0 <\cf4 Type\cf0 > match);\par ??\par ?? \cf3 void\cf0 Scan(\cf4 Action\cf0 <\cf4 IAssemblyScanner\cf0 > action);\par ??\par ?? \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> FillAllPropertiesOfType<PLUGINTYPE>();\par ?? \}} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red0\green128\blue0;}??\fs20 \cf3 public\cf0 \cf3 interface\cf0 \cf4 IInitializationExpression\par ??\cf0 \{\par ?? \cf5 // Directives on how to treat the StructureMap.config file\par ??\cf0 \cf3 bool\cf0 UseDefaultStructureMapConfigFile \{ \cf3 set\cf0 ; \}\par ?? \cf3 bool\cf0 IgnoreStructureMapConfig \{ \cf3 set\cf0 ; \}\par ??\par ?? \cf5 // Xml configuration from the App.Config file\par ??\cf0 \cf3 bool\cf0 PullConfigurationFromAppConfig \{ \cf3 set\cf0 ; \}\par ??\par ?? \cf5 // Ancillary sources of Xml configuration\par ??\cf0 \cf3 void\cf0 AddConfigurationFromXmlFile(\cf3 string\cf0 fileName);\par ?? \cf3 void\cf0 AddConfigurationFromNode(\cf4 XmlNode\cf0 node);\par ??\par ?? \cf5 // Specifying Registry's\par ??\cf0 \cf3 void\cf0 AddRegistry<T>() \cf3 where\cf0 T : \cf4 Registry\cf0 , \cf3 new\cf0 ();\par ?? \cf3 void\cf0 AddRegistry(\cf4 Registry\cf0 registry);\par ??\par ?? \cf5 // Designate the Default Profile. This will be applied as soon as the \par ??\cf0 \cf5 // Container is initialized.\par ??\cf0 \cf3 string\cf0 DefaultProfileName \{ \cf3 get\cf0 ; \cf3 set\cf0 ; \}\par ??\par ?? \cf5 // ... and the Registry DSL as well\par ??\par ??\cf0 \cf5 // The Registry DSL\par ??\cf0 \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> BuildInstancesOf<PLUGINTYPE>();\par ?? \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> ForRequestedType<PLUGINTYPE>();\par ?? \cf4 GenericFamilyExpression\cf0 ForRequestedType(\cf4 Type\cf0 pluginType);\par ?? \cf4 Registry\cf0 .\cf4 BuildWithExpression\cf0 <T> ForConcreteType<T>();\par ??\par ?? \cf4 IsExpression\cf0 <T> InstanceOf<T>();\par ?? \cf4 GenericIsExpression\cf0 InstanceOf(\cf4 Type\cf0 pluginType);\par ??\par ?? \cf4 ProfileExpression\cf0 CreateProfile(\cf3 string\cf0 profileName);\par ?? \cf3 void\cf0 CreateProfile(\cf3 string\cf0 profileName, \cf4 Action\cf0 <\cf4 ProfileExpression\cf0 > action);\par ??\par ?? \cf3 void\cf0 RegisterInterceptor(\cf4 TypeInterceptor\cf0 interceptor);\par ?? \cf4 MatchedTypeInterceptor\cf0 IfTypeMatches(\cf4 Predicate\cf0 <\cf4 Type\cf0 > match);\par ??\par ?? \cf3 void\cf0 Scan(\cf4 Action\cf0 <\cf4 IAssemblyScanner\cf0 > action);\par ??\par ?? \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> FillAllPropertiesOfType<PLUGINTYPE>();\par ?? \}} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> Modified: trunk/Source/HTML/Generics.htm =================================================================== --- trunk/Source/HTML/Generics.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/Generics.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -237,7 +237,7 @@ <p>Great, but now let's move on to registering these classes with a Container. This unit test fixture from the code illustrates this very scenario:</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red0\green0\blue255;\red0\green128\blue0;}??\fs20 [\cf3 SetUp\cf0 ]\par ?? \cf4 public\cf0 \cf4 void\cf0 SetUp()\par ?? \{\par ?? container = \cf4 new\cf0 \cf3 Container\cf0 (x =>\par ?? \{\par ?? \cf5 // Define the basic open type for IFlattener<>\par ??\cf0 x.For(\cf4 typeof\cf0 (\cf3 IFlattener\cf0 <>)).TheDefaultIsConcreteType(\cf4 typeof\cf0 (\cf3 PassthroughFlattener\cf0 <>));\par ?? \par ?? \cf5 // Explicitly Register a specific closed type for Address\par ??\cf0 x.ForRequestedType<\cf3 IFlattener\cf0 <\cf3 Address\cf0 >>().TheDefaultIsConcreteType<\cf3 AddressFlattener\cf0 >();\par ?? \});\par ?? \}} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red0\green0\blue255;\red0\green128\blue0;}??\fs20 [\cf3 SetUp\cf0 ]\par ?? \cf4 public\cf0 \cf4 void\cf0 SetUp()\par ?? \{\par ?? container = \cf4 new\cf0 \cf3 Container\cf0 (x =>\par ?? \{\par ?? \cf5 // Define the basic open type for IFlattener<>\par ??\cf0 x.ForRequestedType(\cf4 typeof\cf0 (\cf3 IFlattener\cf0 <>)).TheDefaultIsConcreteType(\cf4 typeof\cf0 (\cf3 PassthroughFlattener\cf0 <>));\par ?? \par ?? \cf5 // Explicitly Register a specific closed type for Address\par ??\cf0 x.ForRequestedType<\cf3 IFlattener\cf0 <\cf3 Address\cf0 >>().TheDefaultIsConcreteType<\cf3 AddressFlattener\cf0 >();\par ?? \});\par ?? \}} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -258,7 +258,7 @@ <span style="color: green;">// Define the basic open type for IFlattener<></span></p> <p style="margin: 0px;"> - x.For(<span style="color: blue;">typeof</span> (<span + x.ForRequestedType(<span style="color: blue;">typeof</span> (<span style="color: #2b91af;">IFlattener</span><>)).TheDefaultIsConcreteType(<span style="color: blue;">typeof</span> (<span style="color: #2b91af;">PassthroughFlattener</span><>));</p> <p style="margin: 0px;"> Modified: trunk/Source/HTML/InstanceExpression.htm =================================================================== --- trunk/Source/HTML/InstanceExpression.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/InstanceExpression.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -32,7 +32,7 @@ code sample below, the text "**********;" represents a call to an InstanceExpression.</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red0\green128\blue0;\red163\green21\blue21;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 InstanceExampleRegistry\cf0 : \cf4 Registry\par ??\cf0 \{\par ?? \cf3 public\cf0 InstanceExampleRegistry()\par ?? \{\par ?? \cf5 // Shortcut for just specifying "use this type -- with auto wiring"\par ??\cf0 ForRequestedType<\cf4 IService\cf0 >().TheDefaultIsConcreteType<\cf4 RemoteService\cf0 >();\par ?? \par ?? \cf5 // Set the default Instance of a PluginType\par ??\cf0 ForRequestedType<\cf4 IService\cf0 >().TheDefault.Is.OfConcreteType<\cf4 RemoteService\cf0 >();\par ?? \par ?? \cf5 // Add an additional Instance of a PluginType\par ??\cf0 InstanceOf<\cf4 IService\cf0 >().Is.OfConcreteType<\cf4 RemoteService\cf0 >();\par ??\par ?? \cf5 // Add multiple additional Instances of a PluginType\par ??\cf0 ForRequestedType<\cf4 IService\cf0 >().AddInstances(x =>\par ?? \{\par ?? x.ConstructedBy(() => \cf3 new\cf0 \cf4 ColorService\cf0 (\cf6 "Red"\cf0 ));\par ??\par ?? x.OfConcreteType<\cf4 RemoteService\cf0 >();\par ??\par ?? x.Object(\cf3 new\cf0 \cf4 ColorService\cf0 (\cf6 "Red"\cf0 ));\par ?? \});\par ??\par ?? \cf5 // Use the InstanceExpression to define the default Instance\par ??\cf0 \cf5 // of a PluginType within a Profile\par ??\cf0 CreateProfile(\cf6 "Connected"\cf0 , x =>\par ?? \{\par ?? x.Type<\cf4 IService\cf0 >().Is.OfConcreteType<\cf4 RemoteService\cf0 >();\par ?? \});\par ?? \}\par ?? \}} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red0\green128\blue0;\red163\green21\blue21;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 InstanceExampleRegistry\cf0 : \cf4 Registry\par ??\cf0 \{\par ?? \cf3 public\cf0 InstanceExampleRegistry()\par ?? \{\par ?? \cf5 // Shortcut for just specifying "use this type -- with auto wiring"\par ??\cf0 ForRequestedType<\cf4 IService\cf0 >().TheDefaultIsConcreteType<\cf4 RemoteService\cf0 >();\par ?? \par ?? \cf5 // Set the default Instance of a PluginType\par ??\cf0 ForRequestedType<\cf4 IService\cf0 >().Use<\cf4 RemoteService\cf0 >();\par ?? \par ?? \cf5 // Add an additional Instance of a PluginType\par ??\cf0 InstanceOf<\cf4 IService\cf0 >().Is.OfConcreteType<\cf4 RemoteService\cf0 >();\par ??\par ?? \cf5 // Add multiple additional Instances of a PluginType\par ??\cf0 ForRequestedType<\cf4 IService\cf0 >().AddInstances(x =>\par ?? \{\par ?? x.ConstructedBy(() => \cf3 new\cf0 \cf4 ColorService\cf0 (\cf6 "Red"\cf0 ));\par ??\par ?? x.OfConcreteType<\cf4 RemoteService\cf0 >();\par ??\par ?? x.Object(\cf3 new\cf0 \cf4 ColorService\cf0 (\cf6 "Red"\cf0 ));\par ?? \});\par ??\par ?? \cf5 // Use the InstanceExpression to define the default Instance\par ??\cf0 \cf5 // of a PluginType within a Profile\par ??\cf0 CreateProfile(\cf6 "Connected"\cf0 , x =>\par ?? \{\par ?? x.Type<\cf4 IService\cf0 >().Is.OfConcreteType<\cf4 RemoteService\cf0 >();\par ?? \});\par ?? \}\par ?? \}} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -308,7 +308,7 @@ <p style="margin: 0px">            {</p> - <p style="margin: 0px">                registry.ForRequestedType<<span style="color: #2b91af">Thing</span>>().TheDefault.Is.OfConcreteType<<span style="color: #2b91af">Thing</span>>()</p> + <p style="margin: 0px">                registry.ForRequestedType<<span style="color: #2b91af">Thing</span>>().Use<<span style="color: #2b91af">Thing</span>>()</p> <p style="margin: 0px">                    <strong>.WithCtorArg(<span style="color: #a31515">"name"</span>).EqualTo(<span style="color: #a31515">"Jeremy"</span>)</strong></p> @@ -456,12 +456,12 @@ </a> <p>Setter dependencies are configured much like constructor dependencies:</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 registry.ForRequestedType<\cf3 Thing\cf0 >().TheDefault.Is.OfConcreteType<\cf3 Thing\cf0 >()\par ?? .WithCtorArg(\cf4 "name"\cf0 ).EqualTo(\cf4 "Jeremy"\cf0 )\par ?? .WithCtorArg(\cf4 "count"\cf0 ).EqualTo(4)\par ?? .WithCtorArg(\cf4 "average"\cf0 ).EqualTo(.333)\par ?? .SetterDependency<\cf3 Rule\cf0 >().Is(x =>\par ?? \{\par ?? x.OfConcreteType<\cf3 WidgetRule\cf0 >().SetterDependency<\cf3 IWidget\cf0 >().Is(\par ?? c => c.OfConcreteType<\cf3 ColorWidget\cf0 >().WithCtorArg(\cf4 "color"\cf0 ).EqualTo(\cf4 "yellow"\cf0 ));\par ?? \});} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 registry.ForRequestedType<\cf3 Thing\cf0 >().Use<\cf3 Thing\cf0 >()\par ?? .WithCtorArg(\cf4 "name"\cf0 ).EqualTo(\cf4 "Jeremy"\cf0 )\par ?? .WithCtorArg(\cf4 "count"\cf0 ).EqualTo(4)\par ?? .WithCtorArg(\cf4 "average"\cf0 ).EqualTo(.333)\par ?? .SetterDependency<\cf3 Rule\cf0 >().Is(x =>\par ?? \{\par ?? x.OfConcreteType<\cf3 WidgetRule\cf0 >().SetterDependency<\cf3 IWidget\cf0 >().Is(\par ?? c => c.OfConcreteType<\cf3 ColorWidget\cf0 >().WithCtorArg(\cf4 "color"\cf0 ).EqualTo(\cf4 "yellow"\cf0 ));\par ?? \});} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> - registry.ForRequestedType<<span style="color: #2b91af;">Thing</span>>().TheDefault.Is.OfConcreteType<span + registry.ForRequestedType<<span style="color: #2b91af;">Thing</span>>().Use<span style="color: #2b91af;">Thing</span>>()</p> <p style="margin: 0px;"> @@ -522,7 +522,7 @@ <p>StructureMap supports Array arguments of non primitive objects. An array of dependencies or type T can be defined with the TheArrayOf<T>() method shown below.</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 var\cf0 container = \cf3 new\cf0 \cf4 Container\cf0 (x =>\par ?? \{\par ?? x.ForRequestedType<\cf4 Processor\cf0 >().TheDefault.Is.OfConcreteType<\cf4 Processor\cf0 >()\par ?? .WithCtorArg(\cf5 "name"\cf0 ).EqualTo(\cf5 "Jeremy"\cf0 )\par ?? .TheArrayOf<\cf4 IHandler\cf0 >().Contains(y =>\par ?? \{\par ?? y.OfConcreteType<\cf4 Handler1\cf0 >();\par ?? y.OfConcreteType<\cf4 Handler2\cf0 >();\par ?? y.OfConcreteType<\cf4 Handler3\cf0 >();\par ?? \});\par ?? \});} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 var\cf0 container = \cf3 new\cf0 \cf4 Container\cf0 (x =>\par ?? \{\par ?? x.ForRequestedType<\cf4 Processor\cf0 >().Use<\cf4 Processor\cf0 >()\par ?? .WithCtorArg(\cf5 "name"\cf0 ).EqualTo(\cf5 "Jeremy"\cf0 )\par ?? .TheArrayOf<\cf4 IHandler\cf0 >().Contains(y =>\par ?? \{\par ?? y.OfConcreteType<\cf4 Handler1\cf0 >();\par ?? y.OfConcreteType<\cf4 Handler2\cf0 >();\par ?? y.OfConcreteType<\cf4 Handler3\cf0 >();\par ?? \});\par ?? \});} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -533,7 +533,7 @@ {</p> <p style="margin: 0px;"> - x.ForRequestedType<<span style="color: #2b91af;">Processor</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="color: #2b91af;">Processor</span>>().Use<<span style="color: #2b91af;">Processor</span>>()</p> <p style="margin: 0px;"> @@ -728,7 +728,7 @@ (IUrlRegistry, IActionRegistry, and ITypeRegistry) before injecting them into StructureMap:</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 private\cf0 \cf3 readonly\cf0 \cf4 ActionRegistry\cf0 _actionRegistry = \cf3 new\cf0 \cf4 ActionRegistry\cf0 ();\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 ISpecialCaseRouteRegistry\cf0 _specialCaseRouteRegistry = \cf3 new\cf0 \cf4 SpecialCaseRouteRegistry\cf0 ();\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 TypeRegistry\cf0 _typeRegistry = \cf3 new\cf0 \cf4 TypeRegistry\cf0 ();\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 List\cf0 <\cf4 Type\cf0 > _workflowTypes = \cf3 new\cf0 \cf4 List\cf0 <\cf4 Type\cf0 >();\par ?? \cf3 private\cf0 \cf4 UrlGraph\cf0 _graph;\par ?? \cf3 private\cf0 \cf4 ControllerRegistry\cf0 _registry;\par ??\par ?? \cf3 public\cf0 WebRegistry(\cf4 ICollection\cf0 <\cf4 RouteBase\cf0 > routes)\par ?? \{\par ?? createUrlGraph(routes);\par ??\par ?? ForRequestedType<\cf4 IUrlRegistry\cf0 >().TheDefault.Is.Object(_graph);\par ?? ForRequestedType<\cf4 IActionRegistry\cf0 >().TheDefault.Is.Object(_actionRegistry);\par ?? ForRequestedType<\cf4 ITypeRegistry\cf0 >().TheDefault.Is.Object(_typeRegistry);\par ?? ForRequestedType<\cf4 ITypeReport\cf0 >().TheDefaultIsConcreteType<\cf4 WorkflowItemTypeReport\cf0 >();\par ?? ForRequestedType<\cf4 ISpecialCaseRouteRegistry\cf0 >().TheDefault.Is.Object(_specialCaseRouteRegistry);\par ??\par ?? ForRequestedType<\cf4 ILogViewerRegistry\cf0 >()\par ?? .TheDefault.Is.OfConcreteType<\cf4 LogViewerRegistry\cf0 >();\par ??\par ?? ForRequestedType<\cf4 IWebPlatformDetector\cf0 >().TheDefaultIsConcreteType<\cf4 MobileWebPlatformDetector\cf0 >();\par ??\par ?? Scan(x =>\par ?? \{\par ?? x.TheCallingAssembly();\par ?? x.With<\cf4 DefaultConventionScanner\cf0 >();\par ?? \});\par ??\par ?? registerRoutingActions();\par ?? registerSpecialCaseRoutes();\par ?? \}} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 private\cf0 \cf3 readonly\cf0 \cf4 ActionRegistry\cf0 _actionRegistry = \cf3 new\cf0 \cf4 ActionRegistry\cf0 ();\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 ISpecialCaseRouteRegistry\cf0 _specialCaseRouteRegistry = \cf3 new\cf0 \cf4 SpecialCaseRouteRegistry\cf0 ();\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 TypeRegistry\cf0 _typeRegistry = \cf3 new\cf0 \cf4 TypeRegistry\cf0 ();\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 List\cf0 <\cf4 Type\cf0 > _workflowTypes = \cf3 new\cf0 \cf4 List\cf0 <\cf4 Type\cf0 >();\par ?? \cf3 private\cf0 \cf4 UrlGraph\cf0 _graph;\par ?? \cf3 private\cf0 \cf4 ControllerRegistry\cf0 _registry;\par ??\par ?? \cf3 public\cf0 WebRegistry(\cf4 ICollection\cf0 <\cf4 RouteBase\cf0 > routes)\par ?? \{\par ?? createUrlGraph(routes);\par ??\par ?? ForRequestedType<\cf4 IUrlRegistry\cf0 >().TheDefault.Is.Object(_graph);\par ?? ForRequestedType<\cf4 IActionRegistry\cf0 >().TheDefault.Is.Object(_actionRegistry);\par ?? ForRequestedType<\cf4 ITypeRegistry\cf0 >().TheDefault.Is.Object(_typeRegistry);\par ?? ForRequestedType<\cf4 ITypeReport\cf0 >().TheDefaultIsConcreteType<\cf4 WorkflowItemTypeReport\cf0 >();\par ?? ForRequestedType<\cf4 ISpecialCaseRouteRegistry\cf0 >().TheDefault.Is.Object(_specialCaseRouteRegistry);\par ??\par ?? ForRequestedType<\cf4 ILogViewerRegistry\cf0 >()\par ?? .Use<\cf4 LogViewerRegistry\cf0 >();\par ??\par ?? ForRequestedType<\cf4 IWebPlatformDetector\cf0 >().TheDefaultIsConcreteType<\cf4 MobileWebPlatformDetector\cf0 >();\par ??\par ?? Scan(x =>\par ?? \{\par ?? x.TheCallingAssembly();\par ?? x.With<\cf4 DefaultConventionScanner\cf0 >();\par ?? \});\par ??\par ?? registerRoutingActions();\par ?? registerSpecialCaseRoutes();\par ?? \}} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -770,7 +770,7 @@ <p>The Object() method is the pertinant method in the InstanceExpression. There is also an alternative syntax called "IsThis":</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 var\cf0 container = \cf3 new\cf0 \cf4 Container\cf0 (x =>\par ?? \{\par ?? x.ForRequestedType<\cf4 ClassWithDependency\cf0 >().TheDefault.Is.OfConcreteType<\cf4 ClassWithDependency\cf0 >()\par ?? .TheArrayOf<\cf4 Rule\cf0 >().Contains(arr =>\par ?? \{\par ?? arr.IsThis(\cf3 new\cf0 \cf4 ColorRule\cf0 (\cf5 "Red"\cf0 ));\par ?? \});\par ?? \});} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 var\cf0 container = \cf3 new\cf0 \cf4 Container\cf0 (x =>\par ?? \{\par ?? x.ForRequestedType<\cf4 ClassWithDependency\cf0 >().Use<\cf4 ClassWithDependency\cf0 >()\par ?? .TheArrayOf<\cf4 Rule\cf0 >().Contains(arr =>\par ?? \{\par ?? arr.IsThis(\cf3 new\cf0 \cf4 ColorRule\cf0 (\cf5 "Red"\cf0 ));\par ?? \});\par ?? \});} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -781,7 +781,7 @@ {</p> <p style="margin: 0px;"> - x.ForRequestedType<<span style="color: #2b91af;">ClassWithDependency</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="color: #2b91af;">ClassWithDependency</span>>().Use<<span style="color: #2b91af;">ClassWithDependency</span>>()</p> <p style="margin: 0px;"> @@ -860,7 +860,7 @@ when configuring array dependencies or overriding the autowiring defaults. Use the TheInstanceNamed() function as shown below to do this:</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red0\green0\blue255;\red163\green21\blue21;}??\fs20 \cf3 IContainer\cf0 manager = \cf4 new\cf0 \cf3 Container\cf0 (r =>\par ?? \{\par ?? r.InstanceOf<\cf3 IHandler\cf0 >().Is.OfConcreteType<\cf3 Handler1\cf0 >().WithName(\cf5 "One"\cf0 );\par ?? r.InstanceOf<\cf3 IHandler\cf0 >().Is.OfConcreteType<\cf3 Handler2\cf0 >().WithName(\cf5 "Two"\cf0 );\par ??\par ?? r.ForRequestedType<\cf3 Processor\cf0 >().TheDefault.Is.OfConcreteType<\cf3 Processor\cf0 >()\par ?? .WithCtorArg(\cf5 "name"\cf0 ).EqualTo(\cf5 "Jeremy"\cf0 )\par ?? .TheArrayOf<\cf3 IHandler\cf0 >().Contains(x =>\par ?? \{\par ?? x.TheInstanceNamed(\cf5 "Two"\cf0 );\par ?? x.TheInstanceNamed(\cf5 "One"\cf0 );\par ?? \});\par ?? \});} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red0\green0\blue255;\red163\green21\blue21;}??\fs20 \cf3 IContainer\cf0 manager = \cf4 new\cf0 \cf3 Container\cf0 (r =>\par ?? \{\par ?? r.InstanceOf<\cf3 IHandler\cf0 >().Is.OfConcreteType<\cf3 Handler1\cf0 >().WithName(\cf5 "One"\cf0 );\par ?? r.InstanceOf<\cf3 IHandler\cf0 >().Is.OfConcreteType<\cf3 Handler2\cf0 >().WithName(\cf5 "Two"\cf0 );\par ??\par ?? r.ForRequestedType<\cf3 Processor\cf0 >().Use<\cf3 Processor\cf0 >()\par ?? .WithCtorArg(\cf5 "name"\cf0 ).EqualTo(\cf5 "Jeremy"\cf0 )\par ?? .TheArrayOf<\cf3 IHandler\cf0 >().Contains(x =>\par ?? \{\par ?? x.TheInstanceNamed(\cf5 "Two"\cf0 );\par ?? x.TheInstanceNamed(\cf5 "One"\cf0 );\par ?? \});\par ?? \});} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -883,7 +883,7 @@ </p> <p style="margin: 0px;"> - r.ForRequestedType<<span style="color: #2b91af;">Processor</span>>().TheDefault.Is.OfConcreteType<<span + r.ForRequestedType<<span style="color: #2b91af;">Processor</span>>().Use<<span style="color: #2b91af;">Processor</span>>()</p> <p style="margin: 0px;"> Modified: trunk/Source/HTML/Interception.htm =================================================================== --- trunk/Source/HTML/Interception.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/Interception.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -329,7 +329,7 @@ <h2>Apply Interception to all Instances of a PluginType</h2> <p>The same OnCreation(), EnrichWith(), and InterceptWith() methods can be applied - to all Instances of a given PluginType off of the For() or + to all Instances of a given PluginType off of the ForRequestedType() or BuildInstancesOf() methods of the <a href="RegistryDSL.htm">Registry DSL</a>:</p> <!-- {\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;\red0\green0\blue255;}??\fs20 \cf3 // Place the Interception at the PluginType level\par ??\cf0 ForRequestedType<\cf4 IConnectionListener\cf0 >()\par ?? .OnCreation(x => x.StartConnection()) \cf3 // OnCreation\par ??\cf0 .EnrichWith(x => \cf5 new\cf0 \cf4 LoggingDecorator\cf0 (x)) \cf3 // Enrich\par ??\cf0 .InterceptWith(\cf5 new\cf0 \cf4 CustomInterceptor\cf0 ()) \cf3 // Custom Interceptor\par ??\par ??\par ??\cf0 .TheDefaultIsConcreteType<\cf4 ClassThatNeedsSomeBootstrapping\cf0 >();} Modified: trunk/Source/HTML/QuickStart.htm =================================================================== --- trunk/Source/HTML/QuickStart.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/QuickStart.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -223,7 +223,7 @@ {</p> <p style="MARGIN: 0px"> - x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().Use<<span style="COLOR: #2b91af">Repository</span>>()</p> <p style="MARGIN: 0px"> @@ -241,7 +241,7 @@ AppSettings</span></p> <p style="MARGIN: 0px"> - x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().Use<<span style="COLOR: #2b91af">Repository</span>>()</p> <p style="MARGIN: 0px"> @@ -339,7 +339,7 @@ <span style="COLOR: green">// Set up the IRepository</span></p> <p style="MARGIN: 0px"> - x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().Use<<span style="COLOR: #2b91af">Repository</span>>()</p> <p style="MARGIN: 0px"> @@ -402,7 +402,7 @@ </p> <p style="MARGIN: 0px"> - x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().Use<<span style="COLOR: #2b91af">Repository</span>>()</p> <p style="MARGIN: 0px"> @@ -458,7 +458,7 @@ </p> <p style="MARGIN: 0px"> - x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().Use<<span style="COLOR: #2b91af">Repository</span>>()</p> <p style="MARGIN: 0px"> @@ -508,7 +508,7 @@ {</p> <p style="MARGIN: 0px"> - x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="COLOR: #2b91af">IRepository</span>>().Use<<span style="COLOR: #2b91af">Repository</span>>();</p> <p style="MARGIN: 0px"> Modified: trunk/Source/HTML/RegistryDSL.htm =================================================================== --- trunk/Source/HTML/RegistryDSL.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/RegistryDSL.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -166,12 +166,12 @@ <p>The Registry class exposes these methods for configuration. Most of these methods are the root of a Fluent Interface expression.</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;\red0\green0\blue255;}??\fs20 \cf3 // Registering Types -- BuildInstancesOf() and For() are Synonyms\par ??\cf0 \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> BuildInstancesOf<PLUGINTYPE>();\par ?? \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> ForRequestedType<PLUGINTYPE>();\par ?? \par ?? \cf4 GenericFamilyExpression\cf0 For(\cf4 Type\cf0 pluginType);\par ??\par ?? \cf3 // Shortcut for configuring the default configuration of a concrete type\par ??\cf0 \cf4 Registry\cf0 .\cf4 BuildWithExpression\cf0 <T> ForConcreteType<T>();\par ??\par ?? \cf3 // Adding additional Instances of a PluginType\par ??\cf0 \cf4 IsExpression\cf0 <T> InstanceOf<T>();\par ?? \cf4 GenericIsExpression\cf0 InstanceOf(\cf4 Type\cf0 pluginType);\par ??\par ?? \cf3 // Creating or Adding to a Profile\par ??\cf0 \cf4 ProfileExpression\cf0 CreateProfile(\cf5 string\cf0 profileName);\par ?? \cf5 void\cf0 CreateProfile(\cf5 string\cf0 profileName, \cf4 Action\cf0 <\cf4 ProfileExpression\cf0 > action);\par ??\par ?? \cf3 // Interception\par ??\cf0 \cf5 void\cf0 RegisterInterceptor(\cf4 TypeInterceptor\cf0 interceptor);\par ?? \cf4 MatchedTypeInterceptor\cf0 IfTypeMatches(\cf4 Predicate\cf0 <\cf4 Type\cf0 > match);\par ??\par ?? \cf3 // Type Scanning and Auto Registration\par ??\cf0 \cf5 void\cf0 Scan(\cf4 Action\cf0 <\cf4 IAssemblyScanner\cf0 > action);\par ??\par ?? \cf3 // Controlling Setter Injection Behavior\par ??\cf0 \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> FillAllPropertiesOfType<PLUGINTYPE>();\par ?? \cf5 void\cf0 SetAllProperties(\cf4 Action\cf0 <\cf4 SetterConvention\cf0 > action);} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;\red0\green0\blue255;}??\fs20 \cf3 // Registering Types -- BuildInstancesOf() and ForRequestedType() are Synonyms\par ??\cf0 \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> BuildInstancesOf<PLUGINTYPE>();\par ?? \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> ForRequestedType<PLUGINTYPE>();\par ?? \par ?? \cf4 GenericFamilyExpression\cf0 ForRequestedType(\cf4 Type\cf0 pluginType);\par ??\par ?? \cf3 // Shortcut for configuring the default configuration of a concrete type\par ??\cf0 \cf4 Registry\cf0 .\cf4 BuildWithExpression\cf0 <T> ForConcreteType<T>();\par ??\par ?? \cf3 // Adding additional Instances of a PluginType\par ??\cf0 \cf4 IsExpression\cf0 <T> InstanceOf<T>();\par ?? \cf4 GenericIsExpression\cf0 InstanceOf(\cf4 Type\cf0 pluginType);\par ??\par ?? \cf3 // Creating or Adding to a Profile\par ??\cf0 \cf4 ProfileExpression\cf0 CreateProfile(\cf5 string\cf0 profileName);\par ?? \cf5 void\cf0 CreateProfile(\cf5 string\cf0 profileName, \cf4 Action\cf0 <\cf4 ProfileExpression\cf0 > action);\par ??\par ?? \cf3 // Interception\par ??\cf0 \cf5 void\cf0 RegisterInterceptor(\cf4 TypeInterceptor\cf0 interceptor);\par ?? \cf4 MatchedTypeInterceptor\cf0 IfTypeMatches(\cf4 Predicate\cf0 <\cf4 Type\cf0 > match);\par ??\par ?? \cf3 // Type Scanning and Auto Registration\par ??\cf0 \cf5 void\cf0 Scan(\cf4 Action\cf0 <\cf4 IAssemblyScanner\cf0 > action);\par ??\par ?? \cf3 // Controlling Setter Injection Behavior\par ??\cf0 \cf4 CreatePluginFamilyExpression\cf0 <PLUGINTYPE> FillAllPropertiesOfType<PLUGINTYPE>();\par ?? \cf5 void\cf0 SetAllProperties(\cf4 Action\cf0 <\cf4 SetterConvention\cf0 > action);} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> <span style="color: green;">// Registering Types -- - BuildInstancesOf() and For() are Synonyms</span></p> + BuildInstancesOf() and ForRequestedType() are Synonyms</span></p> <p style="margin: 0px;"> <span style="color: #2b91af;"> CreatePluginFamilyExpression</span><PLUGINTYPE> BuildInstancesOf<PLUGINTYPE>();</p> @@ -182,7 +182,7 @@ </p> <p style="margin: 0px;"> <span style="color: #2b91af;">GenericFamilyExpression</span> - For(<span style="color: #2b91af;">Type</span> pluginType);</p> + ForRequestedType(<span style="color: #2b91af;">Type</span> pluginType);</p> <p style="margin: 0px;"> </p> <p style="margin: 0px;"> @@ -289,7 +289,7 @@ object in other ways than a constructor function. In that case, you need to use something like this:</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 // In this case, we need to specify the value of "connectionString" argument to\par ??\cf0 \cf3 // the constructor function\par ??\cf0 x.ForRequestedType<\cf4 DatabaseRepository\cf0 >().TheDefault.Is.OfConcreteType<\cf4 DatabaseRepository\cf0 >()\par ?? .WithCtorArg(\cf5 "connectionString"\cf0 ).EqualToAppSetting(\cf5 "connectionString"\cf0 );} +{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green128\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 // In this case, we need to specify the value of "connectionString" argument to\par ??\cf0 \cf3 // the constructor function\par ??\cf0 x.ForRequestedType<\cf4 DatabaseRepository\cf0 >().Use<\cf4 DatabaseRepository\cf0 >()\par ?? .WithCtorArg(\cf5 "connectionString"\cf0 ).EqualToAppSetting(\cf5 "connectionString"\cf0 );} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -301,7 +301,7 @@ <span style="color: green;">// the constructor function</span></p> <p style="margin: 0px;"> - x.ForRequestedType<<span style="color: #2b91af;">DatabaseRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="color: #2b91af;">DatabaseRepository</span>>().Use<<span style="color: #2b91af;">DatabaseRepository</span>>()</p> <p style="margin: 0px;"> @@ -319,7 +319,7 @@ cannot use the generic ForRequestedType<T>() method. For example, with open generic types, you have to use this syntax:</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 var\cf0 container = \cf3 new\cf0 \cf4 Container\cf0 (r =>\par ?? \{\par ?? r.For(\cf3 typeof\cf0 (\cf4 IRepository\cf0 <>)).TheDefaultIsConcreteType(\cf3 typeof\cf0 (\cf4 OnlineRepository\cf0 <>));\par ?? \});} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 var\cf0 container = \cf3 new\cf0 \cf4 Container\cf0 (r =>\par ?? \{\par ?? r.ForRequestedType(\cf3 typeof\cf0 (\cf4 IRepository\cf0 <>)).TheDefaultIsConcreteType(\cf3 typeof\cf0 (\cf4 OnlineRepository\cf0 <>));\par ?? \});} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -330,7 +330,7 @@ {</p> <p style="margin: 0px;"> - r.For(<span style="color: blue;">typeof</span> (<span + r.ForRequestedType(<span style="color: blue;">typeof</span> (<span style="color: #2b91af;">IRepository</span><>)).TheDefaultIsConcreteType(<span style="color: blue;">typeof</span> (<span style="color: #2b91af;">OnlineRepository</span><>));</p> <p style="margin: 0px;"> @@ -638,7 +638,7 @@ build an instance of the DatabaseRepository class. We could register this class like this:</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 ObjectFactory\cf0 .Initialize(x =>\par ?? \{\par ?? x.ForRequestedType<\cf3 DatabaseRepository\cf0 >().TheDefault.Is.OfConcreteType<\cf3 DatabaseRepository\cf0 >()\par ?? .WithCtorArg(\cf4 "connectionString"\cf0 ).EqualToAppSetting(\cf4 "connectionString"\cf0 );\par ?? \});} +{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf3 ObjectFactory\cf0 .Initialize(x =>\par ?? \{\par ?? x.ForRequestedType<\cf3 DatabaseRepository\cf0 >().Use<\cf3 DatabaseRepository\cf0 >()\par ?? .WithCtorArg(\cf4 "connectionString"\cf0 ).EqualToAppSetting(\cf4 "connectionString"\cf0 );\par ?? \});} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -648,7 +648,7 @@ {</p> <p style="margin: 0px;"> - x.ForRequestedType<<span style="color: #2b91af;">DatabaseRepository</span>>().TheDefault.Is.OfConcreteType<<span + x.ForRequestedType<<span style="color: #2b91af;">DatabaseRepository</span>>().Use<<span style="color: #2b91af;">DatabaseRepository</span>>()</p> <p style="margin: 0px;"> Modified: trunk/Source/HTML/ScanningAssemblies.htm =================================================================== --- trunk/Source/HTML/ScanningAssemblies.htm 2010-02-03 23:16:32 UTC (rev 328) +++ trunk/Source/HTML/ScanningAssemblies.htm 2010-02-04 00:33:40 UTC (rev 329) @@ -333,7 +333,7 @@ The most common usage is probably just specifying "this" assembly with IAssemblyScanner.TheCallingAssembly():</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red0\green128\blue0;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 WebCoreRegistry\cf0 : \cf4 Registry\par ??\cf0 \{\par ?? \cf3 protected\cf0 \cf3 override\cf0 \cf3 void\cf0 configure()\par ?? \{\par ?? ForRequestedType<\cf4 ICachedSet\cf0 >().TheDefaultIsConcreteType<\cf4 CachedSet\cf0 >().CacheBy(\cf4 InstanceScope\cf0 .Hybrid);\par ?? ForRequestedType<\cf4 IControlBuilder\cf0 >().TheDefault.Is.OfConcreteType<\cf4 AspNetControlBuilder\cf0 >();\par ?? ForRequestedType<\cf4 IPartialRenderer\cf0 >().TheDefault.Is.OfConcreteType<\cf4 PartialRenderer\cf0 >();\par ??\par ?? Scan(x =>\par ?? \{\par ?? \cf5 // Scan "this" assembly. In other words, the assembly that \par ??\cf0 \cf5 // contains the WebCoreRegistry class\par ??\cf0 x.TheCallingAssembly();\par ??\par ?? x.IncludeNamespaceContainingType<\cf4 AuthenticationContext\cf0 >();\par ?? x.IncludeNamespaceContainingType<\cf4 ISecurityDataService\cf0 >();\par ??\par ?? x.WithDefaultConventions();\par ?? \});\par ?? \}\par ?? \}} +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red0\green128\blue0;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 WebCoreRegistry\cf0 : \cf4 Registry\par ??\cf0 \{\par ?? \cf3 protected\cf0 \cf3 override\cf0 \cf3 void\cf0 configure()\par ?? \{\par ?? ForRequestedType<\cf4 ICachedSet\cf0 >().TheDefaultIsConcreteType<\cf4 CachedSet\cf0 >().CacheBy(\cf4 InstanceScope\cf0 .Hybrid);\par ?? ForRequestedType<\cf4 IControlBuilder\cf0 >().Use<\cf4 AspNetControlBuilder\cf0 >();\par ?? ForRequestedType<\cf4 IPartialRenderer\cf0 >().Use<\cf4 PartialRenderer\cf0 >();\par ??\par ?? Scan(x =>\par ?? \{\par ?? \cf5 // Scan "this" assembly. In other words, the assembly that \par ??\cf0 \cf5 // contains the WebCoreRegistry class\par ??\cf0 x.TheCallingAssembly();\par ??\par ?? x.IncludeNamespaceContainingType<\cf4 AuthenticationContext\cf0 >();\par ?? x.IncludeNamespaceContainingType<\cf4 ISecurityDataService\cf0 >();\par ??\par ?? x.WithDefaultConventions();\par ?? \});\par ?? \}\par ?? \}} --> <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> <p style="margin: 0px;"> @@ -355,11 +355,11 @@ style="color: #2b91af;">InstanceScope</span>.Hybrid);</p> <p style="margin: 0px;"> ForRequestedType<<span - style="color: #2b91af;">IControlBuilder</span>>().TheDefault.Is.OfConcreteType<<span + style="color: #2b91af;">IControlBuilder</span>>().Use<<span style="color: #2b91af;">AspNetControlBuilder</span>>();</p> <p style="margin: 0px;"> ForRequestedType<<span - style="color: #2b91af;">IPartialRenderer</span>>().TheDefault.Is.OfConcreteType<<span + style="color: #2b91af;">IPartialRenderer</span>>().Use<<span style="color: #2b91af;">PartialRenderer</span>>();</p> <p style="margin: 0px;"> </p> @@ -686,7 +686,7 @@ project (in other words, the scenario that forced us to overhaul the StructureMap auto registration):</p> <!-- -{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;\red0\green12... [truncated message content] |