From: <jer...@us...> - 2008-08-07 20:23:13
|
Revision: 129 http://structuremap.svn.sourceforge.net/structuremap/?rev=129&view=rev Author: jeremydmiller Date: 2008-08-07 20:23:07 +0000 (Thu, 07 Aug 2008) Log Message: ----------- Optional Setter injection, some emitting performance optimization Modified Paths: -------------- trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs trunk/Source/StructureMap/Emitting/ClassBuilder.cs trunk/Source/StructureMap/Emitting/DynamicAssembly.cs trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs trunk/Source/StructureMap/Emitting/Parameters/ChildArrayParameterEmitter.cs trunk/Source/StructureMap/Emitting/Parameters/ChildParameterEmitter.cs trunk/Source/StructureMap/Emitting/Parameters/EnumParameterEmitter.cs trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs trunk/Source/StructureMap/Emitting/Parameters/PrimitiveParameterEmitter.cs trunk/Source/StructureMap/Emitting/Parameters/StringParameterEmitter.cs trunk/Source/StructureMap/Graph/ITypeScanner.cs trunk/Source/StructureMap/Graph/Plugin.cs trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Building.cs trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Expressions.cs trunk/Source/StructureMap/Pipeline/ConfiguredInstance.cs trunk/Source/StructureMap/Pipeline/DefaultInstance.cs trunk/Source/StructureMap/Pipeline/IConfiguredInstance.cs trunk/Source/StructureMap/Pipeline/InstanceMementoPropertyReader.cs trunk/Source/StructureMap/ReflectionHelper.cs trunk/Source/StructureMap/StructureMap.csproj trunk/Source/StructureMap.Testing/Configuration/DSL/AddInstanceTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/CreatePluginFamilyTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/DeepInstanceTester.cs trunk/Source/StructureMap.Testing/Configuration/DefaultInstanceNodeTester.cs trunk/Source/StructureMap.Testing/Configuration/InlineInstanceDefinitionInProfileAndMachineNodesTester.cs trunk/Source/StructureMap.Testing/Graph/ContainerTester.cs trunk/Source/StructureMap.Testing/Graph/EmittingTester.cs trunk/Source/StructureMap.Testing/Graph/PluginTester.cs trunk/Source/StructureMap.Testing/Graph/SetterInjectionEmittingTester.cs trunk/Source/StructureMap.Testing/InstanceMementoInstanceCreationTester.cs trunk/Source/StructureMap.Testing/Pipeline/ConfiguredInstanceTester.cs trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj trunk/Source/StructureMap.Testing/StructureMap.config trunk/Source/StructureMap.Testing/TestData/Array.xml trunk/Source/StructureMap.Testing/TestData/AttributeNormalized.xml trunk/Source/StructureMap.Testing/TestData/Config1.xml trunk/Source/StructureMap.Testing/TestData/FullTesting.XML trunk/Source/StructureMap.Testing/TestData/ObjectMother.config trunk/Source/StructureMap.Testing/TestData/SampleConfig.xml trunk/Source/StructureMap.Testing/TestData/ShortInstance.xml trunk/Source/StructureMap.Testing/TestData/StructureMap.config trunk/Source/StructureMap.Testing.Widget/Hierarchy.cs trunk/Source/StructureMap.Testing.Widget/IWidget.cs trunk/Source/StructureMap.Testing.Widget/Rule.cs trunk/Source/StructureMap.Testing.Widget/StructureMap.Testing.Widget.csproj trunk/Source/StructureMap.Testing.Widget/WidgetMaker.cs trunk/Source/StructureMap.Testing.Widget2/EnumerationCheck.cs trunk/Source/StructureMap.Testing.Widget4/Strategy.cs trunk/Source/StructureMap.Testing.Widget5/WidgetRegistry.cs trunk/Source/StructureMap.sln trunk/StructureMap.config Added Paths: ----------- trunk/Source/HTML/Glossary.htm trunk/Source/StructureMap/ConfigurationClasses.cd trunk/Source/StructureMap/Emitting/Parameters/Methods.cs trunk/Source/StructureMap.DataAccess/Oracle/OracleDatabaseEngine.cs trunk/Source/StructureMap.Testing/Examples/ trunk/Source/StructureMap.Testing/Examples/QuickStart.cs trunk/Source/StructureMap.Testing/Pipeline/OptionalSetterInjectionTester.cs trunk/Source/StructureMap.Testing.Widget/BuilderSamples.cs Added: trunk/Source/HTML/Glossary.htm =================================================================== --- trunk/Source/HTML/Glossary.htm (rev 0) +++ trunk/Source/HTML/Glossary.htm 2008-08-07 20:23:07 UTC (rev 129) @@ -0,0 +1,311 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> + <head> + <title></title> + <style type="text/css"> + .style1 + { + font-family: "Courier New", Courier, monospace; + } + </style> + </head> + <body> + <h1>Glossary</h1> + <p>There are some terms that reoccur throughout the documentation and show up in the StructureMap configuration. Understanding these terms and how they relate to StructureMap isn't a prerequisite to using StructureMap, but it helps.</p> + <h4>Container</h4> + <p>Tools like StructureMap are generally referred to as IoC containers, or in the + Java world sometimes as "lightweight" containers to differentiate them from the + old EJB containers. As far as I know, the term Inversion of Control + Container was coined by members of the PicoContainer team at ThoughtWorks and + popularized by the publication of Martin Fowler's paper + <a href="http://martinfowler.com/articles/injection.html">Inversion of Control + Containers and the Dependency Injection</a> pattern in January 2004. + StructureMap development was already underway when the paper was published. + I was definitely influenced by the paper and PicoContainer itself to a degree, + but I resisted the term "Container" for a long time. StructureMap has a + container class, but it's always been largely hidden behind the static + ObjectFactory class. New in StructureMap 2.5 is an easy way to use the + Container without StructureMapConfiguration or ObjectFactory like 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;\red0\green128\blue0;}??\fs20 \cf3 IContainer\cf0 container = \cf4 new\cf0 \cf3 Container\cf0 (registry =>\par ?? \{\par ?? registry.AddInstanceOf<\cf3 Rule\cf0 >().UsingConcreteType<\cf3 ARule\cf0 >().WithName(\cf5 "Alias"\cf0 );\par ??\par ?? \cf6 // Add an instance by specifying the ConcreteKey\par ??\cf0 registry.AddInstanceOf<\cf3 IWidget\cf0 >()\par ?? .UsingConcreteType<\cf3 ColorWidget\cf0 >()\par ?? .WithName(\cf5 "Purple"\cf0 )\par ?? .WithProperty(\cf5 "Color"\cf0 ).EqualTo(\cf5 "Purple"\cf0 );\par ??\par ?? \cf6 // Specify a new Instance, override a dependency with a named instance\par ??\cf0 registry.AddInstanceOf<\cf3 Rule\cf0 >().UsingConcreteType<\cf3 WidgetRule\cf0 >().WithName(\cf5 "RuleThatUsesMyInstance"\cf0 )\par ?? .Child<\cf3 IWidget\cf0 >(\cf5 "widget"\cf0 ).IsNamedInstance(\cf5 "Purple"\cf0 );\par ?? \});} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: #2b91af;"> + IContainer</span> container = <span style="color: blue;">new</span> + <span style="color: #2b91af;">Container</span>(registry =></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + registry.AddInstanceOf<<span style="color: #2b91af;">Rule</span>>().UsingConcreteType<<span + style="color: #2b91af;">ARule</span>>().WithName(<span + style="color: #a31515;">"Alias"</span>);</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + + <span style="color: green;">// Add an instance by specifying the ConcreteKey</span></p> + <p style="margin: 0px;"> + + registry.AddInstanceOf<<span style="color: #2b91af;">IWidget</span>>()</p> + <p style="margin: 0px;"> + + .UsingConcreteType<<span style="color: #2b91af;">ColorWidget</span>>()</p> + <p style="margin: 0px;"> + + .WithName(<span style="color: #a31515;">"Purple"</span>)</p> + <p style="margin: 0px;"> + + .WithProperty(<span style="color: #a31515;">"Color"</span>).EqualTo(<span + style="color: #a31515;">"Purple"</span>);</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + + <span style="color: green;">// Specify a new Instance, override a dependency + with a named instance</span></p> + <p style="margin: 0px;"> + + registry.AddInstanceOf<<span style="color: #2b91af;">Rule</span>>().UsingConcreteType<<span + style="color: #2b91af;">WidgetRule</span>>().WithName(<span + style="color: #a31515;">"RuleThatUsesMyInstance"</span>)</p> + <p style="margin: 0px;"> + + .Child<<span style="color: #2b91af;">IWidget</span>>(<span + style="color: #a31515;">"widget"</span>).IsNamedInstance(<span + style="color: #a31515;">"Purple"</span>);</p> + <p style="margin: 0px;"> + });</p> + </div> +<!--EndFragment--> +<p> </p> + <h4>PluginType & PluggedType</h4> + <p>I use the term "PluginType" throughout the code and documentation to mean "the + type that you want." In my current project I have this line of + configuration:</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;}??\fs20 ForRequestedType<\cf3 IRepository\cf0 >().TheDefaultIsConcreteType<\cf3 Repository\cf0 >().CacheBy(\cf3 InstanceScope\cf0 .Hybrid);} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + ForRequestedType<<span + style="color: #2b91af;">IRepository</span>>().TheDefaultIsConcreteType<<span + style="color: #2b91af;">Repository</span>>().CacheBy(<span + style="color: #2b91af;">InstanceScope</span>.Hybrid);</p> + </div> +<!--EndFragment--> +<p>If you request an object of <span class="style1">IRepository,</span> you'll get + an instance of the<span class="style1"> Repository</span> class. In this + case, <span class="style1">IRepository</span> is the PluginType (what you're + asking for) and <span class="style1">Repository</span> is the "PluggedType" (the + concrete class you'll get).</p> +<p>Another example of the PluginType / PluggedType nomenclature is in the Xml + configuration on the <DefaultInstance> node. The example below configures + the default ISessionSource:</p> +<!-- +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red255\green0\blue0;\red0\green0\blue0;}??\fs20 \cf1 <\cf3 DefaultInstance\par ??\cf1 \cf4 PluginType\cf1 =\cf0 "\cf1 ShadeTree.DomainModel.ISessionSource,ShadeTree.DomainModel\cf0 "\par ??\cf1 \cf4 PluggedType\cf1 =\cf0 "\cf1 ShadeTree.DomainModel.SessionSource,ShadeTree.DomainModel\cf0 "\cf1 >\par ?? <\cf3 properties\cf1 >\par ?? <\cf3 Pair\cf1 \cf4 Key\cf1 =\cf0 "\cf1 connection.provider\cf0 "\cf1 \cf4 Value\cf1 =\cf0 "\cf1 NHibernate.Connection.DriverConnectionProvider\cf0 "\cf1 />\par ?? <\cf3 Pair\cf1 \cf4 Key\cf1 =\cf0 "\cf1 connection.driver_class\cf0 "\cf1 \cf4 Value\cf1 =\cf0 "\cf1 NHibernate.Driver.SqlClientDriver\cf0 "\cf1 />\par ?? <\cf3 Pair\cf1 \cf4 Key\cf1 =\cf0 "\cf1 dialect\cf0 "\cf1 \cf4 Value\cf1 =\cf0 "\cf1 NHibernate.Dialect.MsSql2000Dialect\cf0 "\cf1 />\par ?? <\cf3 Pair\cf1 \cf4 Key\cf1 =\cf0 "\cf1 hibernate.dialect\cf0 "\cf1 \cf4 Value\cf1 =\cf0 "\cf1 NHibernate.Dialect.MsSql2000Dialect\cf0 "\cf1 />\par ?? <\cf3 Pair\cf1 \cf4 Key\cf1 =\cf0 "\cf1 use_outer_join\cf0 "\cf1 \cf4 Value\cf1 =\cf0 "\cf1 true\cf0 "\cf1 />\par ?? <\cf3 Pair\cf1 \cf4 Key\cf1 =\cf0 "\cf1 connection.connection_string\cf0 "\cf1 \cf4 Value\cf1 =\cf0 "\cf1 Data Source=localhost;Initial Catalog=Blue;Trusted_Connection=yes;\cf0 "\cf1 />\par ?? <\cf3 Pair\cf1 \cf4 Key\cf1 =\cf0 "\cf1 show_sql\cf0 "\cf1 \cf4 Value\cf1 =\cf0 "\cf1 true\cf0 "\cf1 />\par ?? </\cf3 properties\cf1 >\par ?? </\cf3 DefaultInstance\cf1 >} +--> +<div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span style="color: #a31515;">DefaultInstance</span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> </span><span style="color: red;"> + PluginType</span><span style="color: blue;">=</span>"<span style="color: blue;">ShadeTree.DomainModel.ISessionSource,ShadeTree.DomainModel</span>"</p> + <p style="margin: 0px;"> + <span style="color: blue;"> </span><span style="color: red;"> + PluggedType</span><span style="color: blue;">=</span>"<span + style="color: blue;">ShadeTree.DomainModel.SessionSource,ShadeTree.DomainModel</span>"<span + style="color: blue;">></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">properties</span><span style="color: blue;">></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">Pair</span><span style="color: blue;"> </span> + <span style="color: red;">Key</span><span style="color: blue;">=</span>"<span + style="color: blue;">connection.provider</span>"<span style="color: blue;"> + </span><span style="color: red;">Value</span><span style="color: blue;">=</span>"<span + style="color: blue;">NHibernate.Connection.DriverConnectionProvider</span>"<span + style="color: blue;"> /></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">Pair</span><span style="color: blue;"> </span> + <span style="color: red;">Key</span><span style="color: blue;">=</span>"<span + style="color: blue;">connection.driver_class</span>"<span + style="color: blue;"> </span><span style="color: red;">Value</span><span + style="color: blue;">=</span>"<span style="color: blue;">NHibernate.Driver.SqlClientDriver</span>"<span + style="color: blue;"> /></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">Pair</span><span style="color: blue;"> </span> + <span style="color: red;">Key</span><span style="color: blue;">=</span>"<span + style="color: blue;">dialect</span>"<span style="color: blue;"> </span> + <span style="color: red;">Value</span><span style="color: blue;">=</span>"<span + style="color: blue;">NHibernate.Dialect.MsSql2000Dialect</span>"<span + style="color: blue;"> /></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">Pair</span><span style="color: blue;"> </span> + <span style="color: red;">Key</span><span style="color: blue;">=</span>"<span + style="color: blue;">hibernate.dialect</span>"<span style="color: blue;"> + </span><span style="color: red;">Value</span><span style="color: blue;">=</span>"<span + style="color: blue;">NHibernate.Dialect.MsSql2000Dialect</span>"<span + style="color: blue;"> /></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">Pair</span><span style="color: blue;"> </span> + <span style="color: red;">Key</span><span style="color: blue;">=</span>"<span + style="color: blue;">use_outer_join</span>"<span style="color: blue;"> + </span><span style="color: red;">Value</span><span style="color: blue;">=</span>"<span + style="color: blue;">true</span>"<span style="color: blue;"> /></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">Pair</span><span style="color: blue;"> </span> + <span style="color: red;">Key</span><span style="color: blue;">=</span>"<span + style="color: blue;">connection.connection_string</span>"<span + style="color: blue;"> </span><span style="color: red;">Value</span><span + style="color: blue;">=</span>"a connection string"<span + style="color: blue;"> /></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> <</span><span + style="color: #a31515;">Pair</span><span style="color: blue;"> </span> + <span style="color: red;">Key</span><span style="color: blue;">=</span>"<span + style="color: blue;">show_sql</span>"<span style="color: blue;"> </span> + <span style="color: red;">Value</span><span style="color: blue;">=</span>"<span + style="color: blue;">true</span>"<span style="color: blue;"> /></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> </</span><span + style="color: #a31515;">properties</span><span style="color: blue;">></span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> </</span><span style="color: #a31515;">DefaultInstance</span><span + style="color: blue;">></span></p> +</div> +<!--EndFragment--> +<p> </p> + <h4>Instance</h4> + <p>In StructureMap terms, an "Instance" is a named way to build or locate an object + instance for a requested PluginType. There is an actual class in + StructureMap 2.5 that represents an "Instance." An abreviated version of + the abstract Instance class is 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;\red0\green128\blue0;}??\fs20 \cf3 public\cf0 \cf3 abstract\cf0 \cf3 class\cf0 \cf4 Instance\cf0 : \cf4 IDiagnosticInstance\par ??\cf0 \{\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf3 string\cf0 _originalName;\par ?? \cf3 private\cf0 \cf4 InstanceInterceptor\cf0 _interceptor = \cf3 new\cf0 \cf4 NulloInterceptor\cf0 ();\par ?? \cf3 private\cf0 \cf3 string\cf0 _name = \cf4 Guid\cf0 .NewGuid().ToString();\par ??\par ??\par ?? \cf3 protected\cf0 Instance()\par ?? \{\par ?? _originalName = _name;\par ?? \}\par ??\par ?? \cf3 public\cf0 \cf3 string\cf0 Name\par ?? \{\par ?? \cf3 get\cf0 \{ \cf3 return\cf0 _name; \}\par ?? \cf3 set\cf0 \{ _name = \cf3 value\cf0 ; \}\par ?? \}\par ??\par ?? \cf3 public\cf0 \cf3 virtual\cf0 \cf3 object\cf0 Build(\cf4 Type\cf0 pluginType, \cf4 IBuildSession\cf0 session)\par ?? \{\par ?? \cf3 object\cf0 rawValue = createRawObject(pluginType, session);\par ?? \cf3 return\cf0 applyInterception(rawValue, pluginType);\par ?? \}\par ??\par ?? \cf3 private\cf0 \cf3 object\cf0 createRawObject(\cf4 Type\cf0 pluginType, \cf4 IBuildSession\cf0 session)\par ?? \{\par ?? \cf3 try\par ??\cf0 \{\par ?? \cf3 return\cf0 build(pluginType, session);\par ?? \}\par ?? \cf3 catch\cf0 (\cf4 StructureMapException\cf0 ex)\par ?? \{\par ?? \cf3 throw\cf0 ;\par ?? \}\par ?? \cf3 catch\cf0 (\cf4 Exception\cf0 ex)\par ?? \{\par ?? \cf3 throw\cf0 \cf3 new\cf0 \cf4 StructureMapException\cf0 (400, ex);\par ?? \}\par ?? \}\par ??\par ?? \cf3 protected\cf0 \cf3 abstract\cf0 \cf3 object\cf0 build(\cf4 Type\cf0 pluginType, \cf4 IBuildSession\cf0 session);\par ??\par ?? \cf3 public\cf0 \cf4 InstanceInterceptor\cf0 Interceptor\par ?? \{\par ?? \cf3 get\cf0 \{ \cf3 return\cf0 _interceptor; \}\par ?? \cf3 set\cf0 \{ _interceptor = \cf3 value\cf0 ; \}\par ?? \}\par ??\par ??\par ??\par ??\cf3 #region\cf0 IDiagnosticInstance Members\par ??\par ?? \cf3 bool\cf0 \cf4 IDiagnosticInstance\cf0 .CanBePartOfPluginFamily(\cf4 PluginFamily\cf0 family)\par ?? \{\par ?? \cf3 return\cf0 canBePartOfPluginFamily(family);\par ?? \}\par ??\par ?? \cf4 Instance\cf0 \cf4 IDiagnosticInstance\cf0 .FindInstanceForProfile(\cf4 PluginFamily\cf0 family, \cf3 string\cf0 profileName, \cf4 GraphLog\cf0 log)\par ?? \{\par ?? \cf3 return\cf0 findMasterInstance(family, profileName, log);\par ?? \}\par ??\par ?? \cf4 InstanceToken\cf0 \cf4 IDiagnosticInstance\cf0 .CreateToken()\par ?? \{\par ?? \cf3 return\cf0 \cf3 new\cf0 \cf4 InstanceToken\cf0 (Name, getDescription());\par ?? \}\par ??\par ?? \cf3 void\cf0 \cf4 IDiagnosticInstance\cf0 .Preprocess(\cf4 PluginFamily\cf0 family)\par ?? \{\par ?? preprocess(family);\par ?? \}\par ??\par ?? \cf3 protected\cf0 \cf3 virtual\cf0 \cf3 void\cf0 preprocess(\cf4 PluginFamily\cf0 family)\par ?? \{\par ?? \cf5 // no-op;\par ??\cf0 \}\par ??\par ?? \cf3 protected\cf0 \cf3 abstract\cf0 \cf3 string\cf0 getDescription();\par ??\par ??\cf3 #endregion\par ??\par ??\cf0 \cf3 protected\cf0 \cf3 void\cf0 replaceNameIfNotAlreadySet(\cf3 string\cf0 name)\par ?? \{\par ?? \cf3 if\cf0 (_name == _originalName)\par ?? \{\par ?? _name = name;\par ?? \}\par ?? \}\par ??\par ??\par ??\par ?? \cf3 private\cf0 \cf3 object\cf0 applyInterception(\cf3 object\cf0 rawValue, \cf4 Type\cf0 pluginType)\par ?? \{\par ?? \cf3 try\par ??\cf0 \{\par ?? \cf5 // Intercept with the Instance-specific InstanceInterceptor\par ??\cf0 \cf3 return\cf0 _interceptor.Process(rawValue);\par ?? \}\par ?? \cf3 catch\cf0 (\cf4 Exception\cf0 e)\par ?? \{\par ?? \cf3 throw\cf0 \cf3 new\cf0 \cf4 StructureMapException\cf0 (270, e, Name, pluginType);\par ?? \}\par ?? \}\par ??\par ?? \cf3 protected\cf0 \cf3 abstract\cf0 \cf3 object\cf0 build(\cf4 Type\cf0 pluginType, \cf4 IBuildSession\cf0 session);\par ??\par ?? \cf3 protected\cf0 \cf3 virtual\cf0 \cf4 Plugin\cf0 findPlugin(\cf4 PluginCollection\cf0 plugins)\par ?? \{\par ?? \cf3 return\cf0 \cf3 null\cf0 ;\par ?? \}\par ??\par ?? \cf3 protected\cf0 \cf3 virtual\cf0 \cf4 Instance\cf0 findMasterInstance(\cf4 PluginFamily\cf0 family, \cf3 string\cf0 profileName, \cf4 GraphLog\cf0 log)\par ?? \{\par ?? \cf3 return\cf0 \cf3 this\cf0 ;\par ?? \}\par ??\par ?? \cf3 protected\cf0 \cf3 virtual\cf0 \cf3 bool\cf0 canBePartOfPluginFamily(\cf4 PluginFamily\cf0 family)\par ?? \{\par ?? \cf3 return\cf0 \cf3 true\cf0 ;\par ?? \}\par ??\par ??\par ??\par ?? \cf3 internal\cf0 \cf3 virtual\cf0 \cf3 bool\cf0 Matches(\cf4 Plugin\cf0 plugin)\par ?? \{\par ?? \cf3 return\cf0 \cf3 false\cf0 ;\par ?? \}\par ?? \}} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> <span style="color: blue;"> + abstract</span> <span style="color: blue;">class</span> + <span style="color: #2b91af;">Instance</span> : <span style="color: #2b91af;"> + IDiagnosticInstance</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> + <span style="color: blue;">string</span> Name</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + <span style="color: blue;">get</span> { <span style="color: blue;">return</span> + _name; }</p> + <p style="margin: 0px;"> + + <span style="color: blue;">set</span> { _name = <span style="color: blue;">value</span>; + }</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> + <span style="color: blue;">virtual</span> <span style="color: blue;">object</span> + Build(<span style="color: #2b91af;">Type</span> pluginType, + <span style="color: #2b91af;">IBuildSession</span> session)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + <span style="color: blue;">object</span> rawValue = createRawObject(pluginType, + session);</p> + <p style="margin: 0px;"> + + <span style="color: blue;">return</span> applyInterception(rawValue, + pluginType);</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">private</span> + <span style="color: blue;">object</span> createRawObject(<span + style="color: #2b91af;">Type</span> pluginType, + <span style="color: #2b91af;">IBuildSession</span> session)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + <span style="color: blue;">try</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + <span style="color: blue;">return</span> build(pluginType, session);</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + + <span style="color: blue;">catch</span> (<span style="color: #2b91af;">StructureMapException</span> + ex)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + <span style="color: blue;">throw</span>;</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + + <span style="color: blue;">catch</span> (<span style="color: #2b91af;">Exception</span> + ex)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + <span style="color: blue;">throw</span> <span style="color: blue;">new</span> + <span style="color: #2b91af;">StructureMapException</span>(400, ex);</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">protected</span> + <span style="color: blue;">abstract</span> <span style="color: blue;">object</span> + build(<span style="color: #2b91af;">Type</span> pluginType, + <span style="color: #2b91af;">IBuildSession</span> session);</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + }</p> + </div> +<!--EndFragment--> +<p>A single Instance can be assigned to a PluginType as the default. When you + call ObjectFactory.GetInstance<T>(), StructureMap looks for the default Instance + object for PluginType T, then executes the Instance.Build(Type, IBuildSession) + method to create a new object or get an existing object. Note the abstract + build(Type, IBuildSession) method. This is a Template Method that can be + overriden to write your own customized Instance type.</p> +<p>When you call ObjectFactory.Get</p> + <h4>Scoping</h4> + <p>a;lskdfje</p> + <h4>PluginFamily</h4> + <p>a;lskdfj</p> + <h4>Profile</h4> + <p>a;lskdfj</p> + <h4>Interceptor</h4> + <p>a;lskdfj</p> + <h4>PostProcessor</h4> + <p>a;lskdfj</p> + </body> +</html> \ No newline at end of file Added: trunk/Source/StructureMap/ConfigurationClasses.cd =================================================================== --- trunk/Source/StructureMap/ConfigurationClasses.cd (rev 0) +++ trunk/Source/StructureMap/ConfigurationClasses.cd 2008-08-07 20:23:07 UTC (rev 129) @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="utf-8"?> +<ClassDiagram MajorVersion="1" MinorVersion="1"> + <Class Name="StructureMap.Container" Collapsed="true" BaseTypeListCollapsed="true"> + <Position X="3.25" Y="0.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAgAAAAAgAAgIBCAAAABAAgCQAAACBAICAAAQA=</HashCode> + <FileName>Container.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" Collapsed="true" /> + </Class> + <Class Name="StructureMap.InstanceBuilder" Collapsed="true"> + <Position X="5" Y="0.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAQAAAAAAAAQAAAAAAAACAAAAAAAAAAAA=</HashCode> + <FileName>InstanceBuilder.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="StructureMap.InstanceFactory" Collapsed="true" BaseTypeListCollapsed="true"> + <Position X="5" Y="1.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AACBEAAAEgAAAAAAgQAACAEAAAAAgQkAAAAAACAAAAA=</HashCode> + <FileName>InstanceFactory.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" Collapsed="true" /> + </Class> + <Class Name="StructureMap.InstanceCache" Collapsed="true"> + <Position X="3.25" Y="1.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAQAABABAAAAAAAAAAAAAAAAgAAAAAAAAAAA=</HashCode> + <FileName>InstanceCache.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="StructureMap.InstanceBuilderList" Collapsed="true"> + <Position X="6.75" Y="0.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAIAAAAAAAAAAgAQARAAAAAAgIAAEAAAAAAAAAAAiAA=</HashCode> + <FileName>InstanceBuilderList.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="StructureMap.PipelineGraph" Collapsed="true"> + <Position X="6.75" Y="1.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AIABgABAAgIABkQAAAIKAAAAAAghAAEgAAAAACAgAAA=</HashCode> + <FileName>PipelineGraph.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="StructureMap.Pipeline.BuildPolicy" Collapsed="true"> + <Position X="9" Y="2" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAABA=</HashCode> + <FileName>Pipeline\BuildPolicy.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Interface Name="StructureMap.IPipelineGraphVisitor" Collapsed="true"> + <Position X="3.25" Y="2.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAQAAAAAAAAAA=</HashCode> + <FileName>PipelineGraph.cs</FileName> + </TypeIdentifier> + </Interface> + <Delegate Name="StructureMap.MissingFactoryFunction" Collapsed="true"> + <Position X="3.25" Y="3.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAACAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> + <FileName>PipelineGraph.cs</FileName> + </TypeIdentifier> + </Delegate> + <Font Name="Segoe UI" Size="9" /> +</ClassDiagram> \ No newline at end of file Modified: trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -20,41 +20,43 @@ this.ilgen = ilgen; } + private void addSetter(ParameterEmitter emitter, PropertyInfo property, bool isMandatory ) + { + if (isMandatory) + { + emitter.MandatorySetter(ilgen, property); + } + else + { + emitter.OptionalSetter(ilgen, property); + } + } + #region IArgumentVisitor Members public void PrimitiveSetter(PropertyInfo property, bool isMandatory) { - if (!isMandatory) return; - - _primitive.Setter(ilgen, property); + addSetter(_primitive, property, isMandatory); } public void StringSetter(PropertyInfo property, bool isMandatory) { - if (!isMandatory) return; - - _string.Setter(ilgen, property); + addSetter(_string, property, isMandatory); } public void EnumSetter(PropertyInfo property, bool isMandatory) { - if (!isMandatory) return; - - _enum.Setter(ilgen, property); + addSetter(_enum, property, isMandatory); } public void ChildSetter(PropertyInfo property, bool isMandatory) { - if (!isMandatory) return; - - _child.Setter(ilgen, property); + addSetter(_child, property, isMandatory); } public void ChildArraySetter(PropertyInfo property, bool isMandatory) { - if (!isMandatory) return; - - _childArray.Setter(ilgen, property); + addSetter(_childArray, property, isMandatory); } public void PrimitiveParameter(ParameterInfo parameter) Modified: trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs =================================================================== --- trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -38,7 +38,15 @@ protected override void Generate(ILGenerator ilgen) { - ilgen.DeclareLocal(typeof (object)); + ilgen.Emit(OpCodes.Nop); + ilgen.DeclareLocal(_plugin.PluggedType); + ilgen.DeclareLocal(typeof(object)); + + for (int i = 0; i < _plugin.Setters.OptionalCount; i++) + { + ilgen.DeclareLocal(typeof (bool)); + } + ArgumentEmitter arguments = new ArgumentEmitter(ilgen); _plugin.VisitConstructor(arguments); @@ -49,9 +57,12 @@ _plugin.VisitSetters(arguments); + ilgen.Emit(OpCodes.Ldloc_0); + ilgen.Emit(OpCodes.Stloc_1); + ilgen.Emit(OpCodes.Br_S, label); ilgen.MarkLabel(label); - ilgen.Emit(OpCodes.Ldloc_0); + ilgen.Emit(OpCodes.Ldloc_1); ilgen.Emit(OpCodes.Ret); } } Modified: trunk/Source/StructureMap/Emitting/ClassBuilder.cs =================================================================== --- trunk/Source/StructureMap/Emitting/ClassBuilder.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/ClassBuilder.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -2,6 +2,7 @@ using System.Collections; using System.Reflection; using System.Reflection.Emit; +using StructureMap.Emitting.Parameters; namespace StructureMap.Emitting { @@ -102,8 +103,7 @@ gen.Emit(OpCodes.Nop); gen.Emit(OpCodes.Ldtoken, pluggedType); - MethodInfo method = typeof (Type).GetMethod("GetTypeFromHandle"); - gen.Emit(OpCodes.Call, method); + gen.Emit(OpCodes.Call, Methods.GET_TYPE_FROM_HANDLE); gen.Emit(OpCodes.Stloc_0); Modified: trunk/Source/StructureMap/Emitting/DynamicAssembly.cs =================================================================== --- trunk/Source/StructureMap/Emitting/DynamicAssembly.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/DynamicAssembly.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -13,14 +13,14 @@ { private Hashtable _Classes; private bool _isCompiled = false; - private string _Name; - private AssemblyBuilder assemBuilder; + private string _name; + private AssemblyBuilder _assemblyBuilder; private string DLLName; - private ModuleBuilder module; + private ModuleBuilder _module; - public DynamicAssembly(string Name) + public DynamicAssembly(string name) { - _Name = Name; + _name = name; _Classes = new Hashtable(); Init(); @@ -29,7 +29,7 @@ public string Name { - get { return _Name; } + get { return _name; } } public bool IsCompiled @@ -46,25 +46,27 @@ assemName.CultureInfo = new CultureInfo("en"); assemName.SetPublicKeyToken(null); - DLLName = _Name + ".DLL"; - //assemBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemName, AssemblyBuilderAccess.RunAndSave); - assemBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemName, AssemblyBuilderAccess.Run); + DLLName = Name + ".dll"; + _assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemName, AssemblyBuilderAccess.RunAndSave); + //_assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemName, AssemblyBuilderAccess.Run); - //module = assemBuilder.DefineDynamicModule(this.Name, DLLName); - module = assemBuilder.DefineDynamicModule(Name); + _module = _assemblyBuilder.DefineDynamicModule(this.Name, DLLName); + + + //_module = _assemblyBuilder.DefineDynamicModule(Name); } public ClassBuilder AddClass(string ClassName) { - ClassBuilder newClass = new ClassBuilder(module, ClassName); + ClassBuilder newClass = new ClassBuilder(_module, ClassName); storeClass(newClass); return newClass; } public ClassBuilder AddClass(string ClassName, Type superType) { - ClassBuilder newClass = new ClassBuilder(module, ClassName, superType); + ClassBuilder newClass = new ClassBuilder(_module, ClassName, superType); storeClass(newClass); return newClass; } @@ -82,10 +84,12 @@ newClass.Bake(); } + _assemblyBuilder.Save(_name + ".dll"); + //assemBuilder.Save(DLLName); //Assembly assem = AppDomain.CurrentDomain.Load(this.Name); _isCompiled = true; - return (Assembly) assemBuilder; + return (Assembly) _assemblyBuilder; //return assem; } } Modified: trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs =================================================================== --- trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -16,8 +16,9 @@ public InstanceBuilderAssembly(Type pluginType, IEnumerable<Plugin> plugins) { - string assemblyName = guidString() + "InstanceBuilderAssembly"; + string assemblyName = "Builders" + guidString(); _dynamicAssembly = new DynamicAssembly(assemblyName); + _pluginType = pluginType; foreach (Plugin plugin in plugins) @@ -28,7 +29,7 @@ private static string guidString() { - return Guid.NewGuid().ToString().Replace(".", ""); + return Guid.NewGuid().ToString().Replace(".", "").Replace("-", ""); } /// <summary> @@ -85,6 +86,7 @@ public List<InstanceBuilder> Compile() { Assembly assembly = _dynamicAssembly.Compile(); + return _classNames.ConvertAll<InstanceBuilder>( Modified: trunk/Source/StructureMap/Emitting/Parameters/ChildArrayParameterEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/ChildArrayParameterEmitter.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/Parameters/ChildArrayParameterEmitter.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -24,22 +24,18 @@ { ilgen.Emit(OpCodes.Ldarg_2); - //ilgen.Emit(OpCodes.Ldstr, argumentType.GetElementType().AssemblyQualifiedName); ilgen.Emit(OpCodes.Ldtoken, argumentType.GetElementType()); - MethodInfo method = typeof (Type).GetMethod("GetTypeFromHandle"); - ilgen.Emit(OpCodes.Call, method); + ilgen.Emit(OpCodes.Call, Methods.GET_TYPE_FROM_HANDLE); ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldstr, argumentName); - callInstanceMemento(ilgen, "GetChildrenArray"); - - MethodInfo methodCreateInstanceArray = (typeof (IBuildSession).GetMethod("CreateInstanceArray")); - ilgen.Emit(OpCodes.Callvirt, methodCreateInstanceArray); + ilgen.Emit(OpCodes.Callvirt, Methods.GET_CHILDREN_ARRAY); + ilgen.Emit(OpCodes.Callvirt, Methods.CREATE_INSTANCE_ARRAY); cast(ilgen, argumentType); } - public void Setter(ILGenerator ilgen, PropertyInfo property) + public override void MandatorySetter(ILGenerator ilgen, PropertyInfo property) { ilgen.Emit(OpCodes.Ldloc_0); putChildArrayFromInstanceMementoOntoStack(ilgen, property.PropertyType, property.Name); Modified: trunk/Source/StructureMap/Emitting/Parameters/ChildParameterEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/ChildParameterEmitter.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/Parameters/ChildParameterEmitter.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -25,16 +25,15 @@ ilgen.Emit(OpCodes.Ldtoken, parameterType); - MethodInfo method = typeof (Type).GetMethod("GetTypeFromHandle"); - ilgen.Emit(OpCodes.Call, method); + ilgen.Emit(OpCodes.Call, Methods.GET_TYPE_FROM_HANDLE); ilgen.Emit(OpCodes.Ldarg_2); + ilgen.Emit(OpCodes.Callvirt, Methods.GET_CHILD); - callInstanceMemento(ilgen, "GetChild"); cast(ilgen, parameterType); } - public void Setter(ILGenerator ilgen, PropertyInfo property) + public override void MandatorySetter(ILGenerator ilgen, PropertyInfo property) { ilgen.Emit(OpCodes.Ldloc_0); Modified: trunk/Source/StructureMap/Emitting/Parameters/EnumParameterEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/EnumParameterEmitter.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/Parameters/EnumParameterEmitter.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -19,27 +19,20 @@ private void putEnumerationValueFromMementoOntoStack(ILGenerator ilgen, Type argumentType, string argumentName) { - Type typeItself = typeof (Type); - MethodInfo getTypeFromHandleMethod = typeItself.GetMethod("GetTypeFromHandle"); - ilgen.Emit(OpCodes.Ldtoken, argumentType); - ilgen.Emit(OpCodes.Call, getTypeFromHandleMethod); + ilgen.Emit(OpCodes.Call, Methods.GET_TYPE_FROM_HANDLE); ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldstr, argumentName); - callInstanceMemento(ilgen, "GetProperty"); + ilgen.Emit(OpCodes.Callvirt, Methods.GET_PROPERTY); ilgen.Emit(OpCodes.Ldc_I4_1); + ilgen.Emit(OpCodes.Call, Methods.ENUM_PARSE); - Type enumType = typeof (Enum); - MethodInfo parseMethod = - enumType.GetMethod("Parse", new Type[] {typeItself, typeof (string), typeof (bool)}); - ilgen.Emit(OpCodes.Call, parseMethod); - ilgen.Emit(OpCodes.Unbox, argumentType); ilgen.Emit(OpCodes.Ldind_I4); } - public void Setter(ILGenerator ilgen, PropertyInfo property) + public override void MandatorySetter(ILGenerator ilgen, PropertyInfo property) { ilgen.Emit(OpCodes.Ldloc_0); putEnumerationValueFromMementoOntoStack(ilgen, property.PropertyType, property.Name); Added: trunk/Source/StructureMap/Emitting/Parameters/Methods.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/Methods.cs (rev 0) +++ trunk/Source/StructureMap/Emitting/Parameters/Methods.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using StructureMap.Pipeline; +using StructureMap.Util; + +namespace StructureMap.Emitting.Parameters +{ + public static class Methods + { + public static MethodInfo HAS_PROPERTY = ReflectionHelper.GetMethod<IConfiguredInstance>(i => i.HasProperty(null)); + public static MethodInfo GET_CHILDREN_ARRAY = ReflectionHelper.GetMethod<IConfiguredInstance>(i => i.GetChildrenArray(null)); + public static MethodInfo GET_CHILD = ReflectionHelper.GetMethod<IConfiguredInstance>(i => i.GetChild(null, null, null)); + public static MethodInfo CREATE_INSTANCE_ARRAY = ReflectionHelper.GetMethod<IBuildSession>(i => i.CreateInstanceArray(null, null)); + + public static MethodInfo GET_TYPE_FROM_HANDLE = typeof(Type).GetMethod("GetTypeFromHandle"); + + public static readonly MethodInfo GET_PROPERTY = + ReflectionHelper.GetMethod<IConfiguredInstance>(i => i.GetProperty(null)); + + private static Cache<Type, MethodInfo> _parseMethods = new Cache<Type, MethodInfo>(findParse); + + private static MethodInfo findParse(Type t) + { + return t.GetMethod("Parse", BindingFlags.Static | BindingFlags.Public, null, new[] {typeof (string)}, null); + } + + public static MethodInfo ENUM_PARSE = typeof (Enum).GetMethod("Parse", BindingFlags.Static | BindingFlags.Public, null, new[]{typeof(Type), typeof(string), typeof(bool)}, null); + + public static MethodInfo ParseFor(Type type) + { + return _parseMethods.Retrieve(type); + } + } +} Modified: trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -12,12 +12,6 @@ /// </summary> public abstract class ParameterEmitter { - protected void callInstanceMemento(ILGenerator ilgen, string methodName) - { - MethodInfo _method = typeof (IConfiguredInstance).GetMethod(methodName); - ilgen.Emit(OpCodes.Callvirt, _method); - } - protected void cast(ILGenerator ilgen, Type parameterType) { //NOTE: According to the docs, Unbox_Any, when called on a ref type, will just do a Castclass @@ -34,5 +28,28 @@ } } + + public abstract void MandatorySetter(ILGenerator ilgen, PropertyInfo property); + + public void OptionalSetter(ILGenerator ilgen, PropertyInfo property) + { + ilgen.Emit(OpCodes.Ldarg_1); + ilgen.Emit(OpCodes.Ldstr, property.Name); + ilgen.Emit(OpCodes.Callvirt, Methods.HAS_PROPERTY); + ilgen.Emit(OpCodes.Ldc_I4_0); + ilgen.Emit(OpCodes.Ceq); + ilgen.Emit(OpCodes.Stloc_2); + ilgen.Emit(OpCodes.Ldloc_2); + + Label label = ilgen.DefineLabel(); + + ilgen.Emit(OpCodes.Brtrue_S, label); + + MandatorySetter(ilgen, property); + + ilgen.Emit(OpCodes.Nop); + + ilgen.MarkLabel(label); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Emitting/Parameters/PrimitiveParameterEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/PrimitiveParameterEmitter.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/Parameters/PrimitiveParameterEmitter.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -13,30 +13,27 @@ { ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldstr, parameter.Name); - callInstanceMemento(ilgen, "GetProperty"); + ilgen.Emit(OpCodes.Callvirt, Methods.GET_PROPERTY); callParse(parameter.ParameterType, ilgen); } private void callParse(Type argumentType, ILGenerator ilgen) { - BindingFlags bindingAttr = BindingFlags.Static | BindingFlags.Public; - MethodInfo parseMethod = - argumentType.GetMethod("Parse", bindingAttr, null, new [] {typeof (string)}, null); - ilgen.Emit(OpCodes.Call, parseMethod); + ilgen.Emit(OpCodes.Call, Methods.ParseFor(argumentType)); } - - public void Setter(ILGenerator ilgen, PropertyInfo property) + public override void MandatorySetter(ILGenerator ilgen, PropertyInfo property) { ilgen.Emit(OpCodes.Ldloc_0); ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldstr, property.Name); - callInstanceMemento(ilgen, "GetProperty"); + ilgen.Emit(OpCodes.Callvirt, Methods.GET_PROPERTY); callParse(property.PropertyType, ilgen); MethodInfo method = property.GetSetMethod(); ilgen.Emit(OpCodes.Callvirt, method); } + } } \ No newline at end of file Modified: trunk/Source/StructureMap/Emitting/Parameters/StringParameterEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/StringParameterEmitter.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Emitting/Parameters/StringParameterEmitter.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -1,5 +1,6 @@ using System.Reflection; using System.Reflection.Emit; +using StructureMap.Pipeline; namespace StructureMap.Emitting.Parameters { @@ -12,19 +13,16 @@ { ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldstr, parameter.Name); - callInstanceMemento(ilgen, "GetProperty"); + ilgen.Emit(OpCodes.Callvirt, Methods.GET_PROPERTY); } - - public void Setter(ILGenerator ilgen, PropertyInfo property) + public override void MandatorySetter(ILGenerator ilgen, PropertyInfo property) { ilgen.Emit(OpCodes.Ldloc_0); ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldstr, property.Name); - callInstanceMemento(ilgen, "GetProperty"); - - MethodInfo method = property.GetSetMethod(); - ilgen.Emit(OpCodes.Callvirt, method); + ilgen.Emit(OpCodes.Callvirt, Methods.GET_PROPERTY); + ilgen.Emit(OpCodes.Callvirt, property.GetSetMethod()); } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/ITypeScanner.cs =================================================================== --- trunk/Source/StructureMap/Graph/ITypeScanner.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Graph/ITypeScanner.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -17,8 +17,10 @@ { if (!IsConcrete(type)) return; + + Type pluginType = FindPluginType(type); - if (pluginType != null) + if (pluginType != null && Plugin.CreateForConcreteType(type) != null) { registry.ForRequestedType(pluginType).AddInstance(new ConfiguredInstance(type)); } Modified: trunk/Source/StructureMap/Graph/Plugin.cs =================================================================== --- trunk/Source/StructureMap/Graph/Plugin.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Graph/Plugin.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -84,7 +84,7 @@ return new ConfiguredInstance(PluggedType).WithConcreteKey(ConcreteKey).WithName(ConcreteKey); } - public string FindFirstConstructorArgumentOfType<T>() + public string FindArgumentNameForType<T>() { string returnValue = _constructor.FindFirstConstructorArgumentOfType<T>() ?? @@ -135,5 +135,10 @@ return new Plugin(type, DEFAULT); } + + public bool HasOptionalSetters() + { + return _setters.OptionalCount > 0; + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Building.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Building.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Building.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -66,5 +66,9 @@ } } + bool IConfiguredInstance.HasProperty(string propertyName) + { + return _properties.ContainsKey(propertyName) || _children.ContainsKey(propertyName) || _arrays.ContainsKey(propertyName); + } } } Modified: trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Expressions.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Expressions.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Pipeline/ConfiguredInstance.Expressions.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -110,7 +110,7 @@ private string findPropertyName<T>() { Plugin plugin = new Plugin(_pluggedType); - string propertyName = plugin.FindFirstConstructorArgumentOfType<T>(); + string propertyName = plugin.FindArgumentNameForType<T>(); if (string.IsNullOrEmpty(propertyName)) { @@ -233,6 +233,12 @@ LiteralInstance instance = new LiteralInstance(value); return Is(instance); } + + public ConfiguredInstance IsAutoFilled() + { + DefaultInstance instance = new DefaultInstance(); + return Is(instance); + } } #endregion Modified: trunk/Source/StructureMap/Pipeline/ConfiguredInstance.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/ConfiguredInstance.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Pipeline/ConfiguredInstance.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -151,6 +151,8 @@ private void setChild(string name, Instance instance) { + if (instance == null) return; + _children.Add(name, instance); } @@ -188,12 +190,5 @@ } } - public void ForProperty(string propertyName, Action<string> action) - { - if (_properties.ContainsKey(propertyName)) - { - action(_properties[propertyName]); - } - } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/DefaultInstance.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/DefaultInstance.cs 2008-07-27 14:01:47 UTC (rev 128) +++ trunk/Source/StructureMap/Pipeline/DefaultInstance.cs 2008-08-07 20:23:07 UTC (rev 129) @@ -4,6 +4,11 @@ { public class DefaultInstance : Instance { + public DefaultInstance() + { + int x = 1; + } ... [truncated message content] |
From: <fli...@us...> - 2008-09-30 18:00:39
|
Revision: 158 http://structuremap.svn.sourceforge.net/structuremap/?rev=158&view=rev Author: flimflan Date: 2008-09-30 18:00:10 +0000 (Tue, 30 Sep 2008) Log Message: ----------- Steven Harman thought it was non-intuitive that he had to run the cruise build locally. A little renaming should help him get over that fear. Added Paths: ----------- trunk/RunBuild.BAT Removed Paths: ------------- trunk/RunCruiseBuild.BAT Copied: trunk/RunBuild.BAT (from rev 157, trunk/RunCruiseBuild.BAT) =================================================================== --- trunk/RunBuild.BAT (rev 0) +++ trunk/RunBuild.BAT 2008-09-30 18:00:10 UTC (rev 158) @@ -0,0 +1,2 @@ +bin\nant\nant.exe -buildfile:cruise.build cruise +pause Property changes on: trunk/RunBuild.BAT ___________________________________________________________________ Added: svn:mergeinfo + Deleted: trunk/RunCruiseBuild.BAT =================================================================== --- trunk/RunCruiseBuild.BAT 2008-09-26 01:03:19 UTC (rev 157) +++ trunk/RunCruiseBuild.BAT 2008-09-30 18:00:10 UTC (rev 158) @@ -1,2 +0,0 @@ -bin\nant\nant.exe -buildfile:cruise.build cruise -pause This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2008-10-08 18:14:19
|
Revision: 177 http://structuremap.svn.sourceforge.net/structuremap/?rev=177&view=rev Author: flimflan Date: 2008-10-08 18:14:10 +0000 (Wed, 08 Oct 2008) Log Message: ----------- Upgraded Rhino.Mocks.dll for RhinoAutoMocker to Rhino 3.5 RTM Modified Paths: -------------- trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj trunk/bin/Rhino.Mocks.dll Modified: trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs =================================================================== --- trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs 2008-10-06 14:52:15 UTC (rev 176) +++ trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs 2008-10-08 18:14:10 UTC (rev 177) @@ -157,7 +157,7 @@ /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> - public T AddAdditionalMockFor<T>() + public T AddAdditionalMockFor<T>() where T : class { var mock = DynamicMock<T>(); _container.Configure(r => r.InstanceOf<T>().Is.Object(mock)); @@ -184,7 +184,7 @@ /// <typeparam name="T"></typeparam> /// <param name="count"></param> /// <returns></returns> - public T[] CreateMockArrayFor<T>(int count) + public T[] CreateMockArrayFor<T>(int count) where T : class { var returnValue = new T[count]; Modified: trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj =================================================================== --- trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj 2008-10-06 14:52:15 UTC (rev 176) +++ trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj 2008-10-08 18:14:10 UTC (rev 177) @@ -51,7 +51,7 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Rhino.Mocks, Version=2.9.1.10183, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL"> + <Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\bin\Rhino.Mocks.dll</HintPath> </Reference> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2008-10-17 14:40:39
|
Revision: 182 http://structuremap.svn.sourceforge.net/structuremap/?rev=182&view=rev Author: flimflan Date: 2008-10-17 14:40:26 +0000 (Fri, 17 Oct 2008) Log Message: ----------- - Added ability to scan all assemblies in a path of the file system. - Now includes the .pdb and intellisense .xml in the build output Modified Paths: -------------- trunk/Source/StructureMap/Graph/AssemblyScanner.cs trunk/Source/StructureMap/StructureMap.csproj trunk/Source/StructureMap.Testing/Graph/AssemblyScannerTester.cs trunk/cruise.build Modified: trunk/Source/StructureMap/Graph/AssemblyScanner.cs =================================================================== --- trunk/Source/StructureMap/Graph/AssemblyScanner.cs 2008-10-10 21:11:00 UTC (rev 181) +++ trunk/Source/StructureMap/Graph/AssemblyScanner.cs 2008-10-17 14:40:26 UTC (rev 182) @@ -227,5 +227,33 @@ { Exclude(type => type == typeof (T)); } + + public void AssembliesFromPath(string path) + { + AssembliesFromPath(path, a => true); + } + + public void AssembliesFromPath(string path, Predicate<Assembly> assemblyFilter) + { + var assemblyPaths = System.IO.Directory.GetFiles(path).Where(file => + System.IO.Path.GetExtension(file).Equals( + ".exe", StringComparison.OrdinalIgnoreCase) + || + System.IO.Path.GetExtension(file).Equals( + ".dll", StringComparison.OrdinalIgnoreCase)); + + foreach (var assemblyPath in assemblyPaths) + { + Assembly assembly = null; + try + { + assembly = System.Reflection.Assembly.LoadFrom(assemblyPath); + } + catch + { + } + if (assembly != null && assemblyFilter(assembly)) Assembly(assembly); + } + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/StructureMap.csproj =================================================================== --- trunk/Source/StructureMap/StructureMap.csproj 2008-10-10 21:11:00 UTC (rev 181) +++ trunk/Source/StructureMap/StructureMap.csproj 2008-10-17 14:40:26 UTC (rev 182) @@ -75,9 +75,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE</DefineConstants> - <DocumentationFile> - </DocumentationFile> - <DebugSymbols>false</DebugSymbols> + <DocumentationFile>bin\Release\StructureMap.XML</DocumentationFile> + <DebugSymbols>true</DebugSymbols> <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> <NoWarn> @@ -87,7 +86,7 @@ <RemoveIntegerChecks>false</RemoveIntegerChecks> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <DebugType>none</DebugType> + <DebugType>pdbonly</DebugType> <ErrorReport>prompt</ErrorReport> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Build|AnyCPU' "> Modified: trunk/Source/StructureMap.Testing/Graph/AssemblyScannerTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Graph/AssemblyScannerTester.cs 2008-10-10 21:11:00 UTC (rev 181) +++ trunk/Source/StructureMap.Testing/Graph/AssemblyScannerTester.cs 2008-10-17 14:40:26 UTC (rev 182) @@ -1,8 +1,10 @@ using System; +using System.IO; using NUnit.Framework; using StructureMap.Configuration.DSL; using StructureMap.Graph; using StructureMap.Testing.Widget; +using System.Linq; using StructureMap.Testing.Widget5; namespace StructureMap.Testing.Graph @@ -29,17 +31,32 @@ { #region Setup/Teardown + [TestFixtureSetUp] + public void FixtureSetUp() + { + var binFolder = Path.GetDirectoryName(GetType().Assembly.Location); + assemblyScanningFolder = Path.Combine(binFolder, "DynamicallyLoaded"); + if (!Directory.Exists(assemblyScanningFolder)) Directory.CreateDirectory(assemblyScanningFolder); + + var assembly1 = typeof (RedGreenRegistry).Assembly.Location; + var assembly2 = typeof(Widget3.IWorker).Assembly.Location; + + File.Copy(assembly1, Path.Combine(assemblyScanningFolder, Path.GetFileName(assembly1)), true); + File.Copy(assembly2, Path.Combine(assemblyScanningFolder, Path.GetFileName(assembly2)), true); + } + [SetUp] public void SetUp() { TestingRegistry.Reset(); - + theGraph = null; } #endregion private PluginGraph theGraph; + private string assemblyScanningFolder; private void Scan(Action<AssemblyScanner> action) { @@ -57,9 +74,22 @@ private void shouldNotHaveFamily<T>() { - theGraph.PluginFamilies.Contains(typeof (T)).ShouldBeFalse(); + theGraph.PluginFamilies.Contains(typeof(T)).ShouldBeFalse(); } + + private void shouldHaveFamilyWithSameName<T>() + { + // The Types may not be "Equal" if their assemblies were loaded in different load contexts (.LoadFrom) + // so we will consider them equal if their names match. + theGraph.PluginFamilies.Any(family => family.PluginType.FullName == typeof (T).FullName).ShouldBeTrue(); + } + + private void shouldNotHaveFamilyWithSameName<T>() + { + theGraph.PluginFamilies.Any(family => family.PluginType.FullName == typeof(T).FullName).ShouldBeFalse(); + } + [Test] public void AssemblyScanner_will_scan_for_attributes_by_default() { @@ -111,6 +141,24 @@ } [Test] + public void scan_all_assemblies_in_a_folder() + { + Scan(x => x.AssembliesFromPath(assemblyScanningFolder) ); + shouldHaveFamilyWithSameName<IInterfaceInWidget5>(); + shouldHaveFamilyWithSameName<Widget3.IWorker>(); + } + + [Test] + public void scan_specific_assemblies_in_a_folder() + { + var assemblyToSpecificallyExclude = typeof(Widget3.IWorker).Assembly.GetName().Name; + Scan(x => x.AssembliesFromPath(assemblyScanningFolder, asm => asm.GetName().Name != assemblyToSpecificallyExclude)); + + shouldHaveFamilyWithSameName<IInterfaceInWidget5>(); + shouldNotHaveFamilyWithSameName<Widget3.IWorker>(); + } + + [Test] public void test_the_family_attribute_scanner() { var scanner = new FamilyAttributeScanner(); Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2008-10-10 21:11:00 UTC (rev 181) +++ trunk/cruise.build 2008-10-17 14:40:26 UTC (rev 182) @@ -69,6 +69,7 @@ <fileset basedir="source\"> <include name="**\bin\${project.config}\*.dll" /> <include name="**\bin\${project.config}\*.exe" /> + <include name="**\bin\${project.config}\*.pdb" /> <include name="**\bin\${project.config}\*.xml" /> <include name="**\bin\${project.config}\*.xml.actual" /> <include name="StructureMap.Testing\*.config" /> @@ -126,6 +127,7 @@ <fileset basedir="${build.dir}"> <include name="*.xml" /> <include name="*.config" /> + <exclude name="structuremap.xml" /> </fileset> </delete> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jer...@us...> - 2008-10-27 02:13:46
|
Revision: 194 http://structuremap.svn.sourceforge.net/structuremap/?rev=194&view=rev Author: jeremydmiller Date: 2008-10-27 02:13:42 +0000 (Mon, 27 Oct 2008) Log Message: ----------- some cleanup on the NAnt file, and the CHM file Modified Paths: -------------- trunk/README.TXT trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj trunk/cruise.build Added Paths: ----------- trunk/StructureMap.chm Modified: trunk/README.TXT =================================================================== --- trunk/README.TXT 2008-10-27 01:07:28 UTC (rev 193) +++ trunk/README.TXT 2008-10-27 02:13:42 UTC (rev 194) @@ -1,4 +1,4 @@ -To start using StructureMap, either use the DLL's in the build folder or click on the RunBuild.BAT file to run the full NAnt build. There is a known issue with the build "sticking" on the custom NAnt tasks. If this happens, delete the copies of StructureMap.Dll and StructureMap.DeploymentTasks.Dll in the bin\NAnt folder. Look in the "build" directory for the build products. +To start using StructureMap, either use the DLL's in the "deploy" folder or click on the RunBuild.BAT file to run the full NAnt build. There is a known issue with the build "sticking" on the custom NAnt tasks. If this happens, delete the copies of StructureMap.Dll and StructureMap.DeploymentTasks.Dll in the bin\NAnt folder. Look in the "build" directory for the build products. A copy of the StructureMap website and documentation is in the "Docs" folder. Modified: trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj =================================================================== --- trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj 2008-10-27 01:07:28 UTC (rev 193) +++ trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj 2008-10-27 02:13:42 UTC (rev 194) @@ -41,6 +41,7 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <DocumentationFile>bin\Debug\StructureMap.AutoMocking.XML</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -49,6 +50,7 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <DocumentationFile>bin\Release\StructureMap.AutoMocking.XML</DocumentationFile> </PropertyGroup> <ItemGroup> <Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL"> Added: trunk/StructureMap.chm =================================================================== (Binary files differ) Property changes on: trunk/StructureMap.chm ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2008-10-27 01:07:28 UTC (rev 193) +++ trunk/cruise.build 2008-10-27 02:13:42 UTC (rev 194) @@ -121,17 +121,27 @@ <target name="post-clean"> - <call target="cleanJunk" /> + + <delete dir="deploy" failonerror="false" /> + <mkdir dir="deploy" /> - <delete> - <fileset basedir="${build.dir}"> - <include name="*.xml" /> - <include name="*.config" /> - <exclude name="structuremap.xml" /> - </fileset> - </delete> + <copy todir="deploy" flatten="true" overwrite="true"> + <fileset basedir="source\StructureMap.Testing\bin\${project.config}"> + <include name="StructureMap.dll" /> + <include name="StructureMap.xml" /> + <include name="StructureMap.AutoMocking.dll" /> + <include name="StructureMap.AutoMocking.xml" /> + </fileset> + </copy> + <copy todir="deploy" file="bin\Rhino.Mocks.dll"/> + <copy todir="deploy" file="StructureMap.chm"/> + + <copy todir="deploy" file="Source\StructureMapDoctor\bin\${project.config}\StructureMapDoctor.exe" /> + + <call target="cleanJunk" /> </target> + <target name="archive"> <if test="${property::exists('CCNetLabel')}"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2008-12-17 16:42:12
|
Revision: 198 http://structuremap.svn.sourceforge.net/structuremap/?rev=198&view=rev Author: flimflan Date: 2008-12-17 16:41:58 +0000 (Wed, 17 Dec 2008) Log Message: ----------- - Fixed TryGetInstance methods so that they are static - Added early code for IContainer debugger visualizer (use at your own risk - see README.TXT) Modified Paths: -------------- trunk/README.TXT trunk/Source/StructureMap/ObjectFactory.cs trunk/Source/StructureMap.sln trunk/cruise.build Added Paths: ----------- trunk/Source/StructureMap.DebuggerVisualizers/ trunk/Source/StructureMap.DebuggerVisualizers/ContainerDetail.cs trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.Designer.cs trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.cs trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.resx trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizer.cs trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizerObjectSource.cs trunk/Source/StructureMap.DebuggerVisualizers/DisplayHelper.cs trunk/Source/StructureMap.DebuggerVisualizers/Properties/ trunk/Source/StructureMap.DebuggerVisualizers/Properties/AssemblyInfo.cs trunk/Source/StructureMap.DebuggerVisualizers/StructureMap.DebuggerVisualizers.csproj Removed Paths: ------------- trunk/Source/StructureMap.lnk Modified: trunk/README.TXT =================================================================== --- trunk/README.TXT 2008-12-17 04:35:54 UTC (rev 197) +++ trunk/README.TXT 2008-12-17 16:41:58 UTC (rev 198) @@ -1,10 +1,15 @@ To start using StructureMap, either use the DLL's in the "deploy" folder or click on the RunBuild.BAT file to run the full NAnt build. There is a known issue with the build "sticking" on the custom NAnt tasks. If this happens, delete the copies of StructureMap.Dll and StructureMap.DeploymentTasks.Dll in the bin\NAnt folder. Look in the "build" directory for the build products. +To enable the debugger visualizers in Visual Studio 2008, put a copy of StructureMap.dll and StructureMap.DebuggerVisualizers.dll in "<My Documents>\Visual Studio 2008\Visualizers" +**WARNING: The visualizer is very early and not well tested. You may experience issues (unhandled exceptions while using the visualizer) if the version of StructureMap.dll in your project is not the exact version in your Visualizers folder. + A copy of the StructureMap website and documentation is in the "Docs" folder. -Contact jer...@ya... with any questions or bugs. +Please post any questions or bugs to the StructureMap Users mailing list: +http://groups.google.com/group/structuremap-users + The latest code and documentation is available on SourceForge: http://structuremap.sourceforge.net/ Modified: trunk/Source/StructureMap/ObjectFactory.cs =================================================================== --- trunk/Source/StructureMap/ObjectFactory.cs 2008-12-17 04:35:54 UTC (rev 197) +++ trunk/Source/StructureMap/ObjectFactory.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -13,7 +13,7 @@ /// The main static Facade for the StructureMap container /// </summary> [EnvironmentPermission(SecurityAction.Assert, Read = "COMPUTERNAME")] - public class ObjectFactory + public static class ObjectFactory { private static readonly object _lockObject = new object(); private static Container _container; @@ -379,7 +379,7 @@ /// <param name="instanceKey"></param> /// <param name="instance"></param> /// <returns></returns> - public object TryGetInstance(Type pluginType, string instanceKey) + public static object TryGetInstance(Type pluginType, string instanceKey) { return container.TryGetInstance(pluginType, instanceKey); } @@ -390,7 +390,7 @@ /// <param name="pluginType"></param> /// <param name="instance"></param> /// <returns></returns> - public object TryGetInstance(Type pluginType) + public static object TryGetInstance(Type pluginType) { return container.TryGetInstance(pluginType); } @@ -401,7 +401,7 @@ /// <typeparam name="T"></typeparam> /// <param name="instance"></param> /// <returns></returns> - public T TryGetInstance<T>() + public static T TryGetInstance<T>() { return container.TryGetInstance<T>(); } @@ -412,7 +412,7 @@ /// <typeparam name="T"></typeparam> /// <param name="instance"></param> /// <returns></returns> - public T TryGetInstance<T>(string instanceKey) + public static T TryGetInstance<T>(string instanceKey) { return container.TryGetInstance<T>(instanceKey); } Property changes on: trunk/Source/StructureMap.DebuggerVisualizers ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Added: trunk/Source/StructureMap.DebuggerVisualizers/ContainerDetail.cs =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/ContainerDetail.cs (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/ContainerDetail.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; + +namespace StructureMap.DebuggerVisualizers +{ + [Serializable] + public class ContainerDetail + { + private readonly string[] _sources; + private readonly PluginTypeDetail[] _pluginTypeDetails; + + public ContainerDetail(string[] sources, PluginTypeDetail[] types) + { + _sources = sources; + _pluginTypeDetails = types; + } + + public string[] Sources + { + get { return _sources; } + } + + public PluginTypeDetail[] PluginTypes + { + get { return _pluginTypeDetails; } + } + } + + [Serializable] + public class PluginTypeDetail + { + private readonly Type _type; + private readonly Type _buildPolicyType; + private readonly InstanceDetail[] instanceDetails; + private readonly IList<InstanceDetail> _instances = new List<InstanceDetail>(); + + public PluginTypeDetail(Type type, Type buildPolicyType, InstanceDetail[] instanceDetails) + { + _type = type; + _buildPolicyType = buildPolicyType; + this.instanceDetails = instanceDetails; + } + + public InstanceDetail[] Instances + { + get { return instanceDetails; } + } + + public Type BuildPolicy + { + get { return _buildPolicyType; } + } + + public Type Type + { + get { return _type; } + } + } + + [Serializable] + public class InstanceDetail + { + private readonly string _name; + private readonly string _description; + private readonly Type _concreteType; + + public InstanceDetail(string name, string description, Type concreteType) + { + _name = name; + _description = description; + _concreteType = concreteType; + } + + public Type ConcreteType + { + get { return _concreteType; } + } + + public string Description + { + get { return _description; } + } + + public string Name + { + get { return _name; } + } + } + +} \ No newline at end of file Property changes on: trunk/Source/StructureMap.DebuggerVisualizers/ContainerDetail.cs ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.Designer.cs =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.Designer.cs (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.Designer.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,68 @@ +namespace StructureMap.DebuggerVisualizers +{ + partial class ContainerForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.BrowserTree = new System.Windows.Forms.TreeView(); + this.SuspendLayout(); + // + // BrowserTree + // + this.BrowserTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.BrowserTree.Location = new System.Drawing.Point(12, 12); + this.BrowserTree.Name = "BrowserTree"; + this.BrowserTree.ShowRootLines = false; + this.BrowserTree.Size = new System.Drawing.Size(548, 249); + this.BrowserTree.TabIndex = 4; + this.BrowserTree.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.BrowserTree_AfterExpand); + // + // ContainerForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(572, 273); + this.Controls.Add(this.BrowserTree); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(280, 80); + this.Name = "ContainerForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; + this.Text = "StructureMap Container Browser"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TreeView BrowserTree; + + + + } +} \ No newline at end of file Added: trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.cs =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.cs (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,88 @@ +using System.Windows.Forms; +using System.Linq; + +namespace StructureMap.DebuggerVisualizers +{ + public partial class ContainerForm : Form + { + + public ContainerForm() + { + InitializeComponent(); + } + + public ContainerForm(ContainerDetail containerDetail) + { + InitializeComponent(); + buildTree(BrowserTree, containerDetail); + } + + private static void buildTree(TreeView tree, ContainerDetail container) + { + var sourcesRoot = buildConfigurationSources(tree, container); + var pluginTypesRoot = buildPluginTypes(tree, container); + + pluginTypesRoot.Expand(); + sourcesRoot.Expand(); + } + + private static TreeNode buildPluginTypes(TreeView tree, ContainerDetail container) + { + var pluginTypesRoot = tree.Nodes.Add("PluginTypes"); + foreach (var pluginType in container.PluginTypes.OrderBy(t => t.Type.Name)) + { + addPluginType(pluginTypesRoot, pluginType); + } + return pluginTypesRoot; + } + + private static TreeNode buildConfigurationSources(TreeView tree, ContainerDetail container) + { + var sourcesRoot = tree.Nodes.Add("Configuration Sources"); + foreach (var source in container.Sources.OrderBy(s => s)) + { + addSource(sourcesRoot, source); + } + return sourcesRoot; + } + + private static void addSource(TreeNode root, string source) + { + root.Nodes.Add(source); + } + + private static void addPluginType(TreeNode pluginTypesRoot, PluginTypeDetail pluginType) + { + var pluginNode = pluginTypesRoot.Nodes.Add(pluginType.Type.AsCSharp()); + pluginNode.Nodes.Add("FullName: " + pluginType.Type.AsCSharp(t=>t.FullName ?? t.Name)); + pluginNode.Nodes.Add("Assembly: " + pluginType.Type.Assembly); + pluginNode.Nodes.Add("BuildPolicy: " + pluginType.BuildPolicy.Name); + if (pluginType.Instances.Length == 0) return; + + var instancesRoot = pluginNode.Nodes.Add("Instances"); + foreach (var instance in pluginType.Instances.OrderBy(i => i.Name)) + { + addInstance(instancesRoot, instance); + } + } + + private static void addInstance(TreeNode instancesRoot, InstanceDetail instance) + { + var instanceNode = instancesRoot.Nodes.Add("Name: " + instance.Name); + if (instance.Name != instance.Description) + { + instanceNode.Nodes.Add("Description: " + instance.Description); + } + if (instance.ConcreteType != null) + { + instanceNode.Nodes.Add("ConcreteType: " + instance.ConcreteType.AsCSharp()); + } + } + + private void BrowserTree_AfterExpand(object sender, TreeViewEventArgs e) + { + if (e.Node.Level < 1) return; + e.Node.ExpandAll(); + } + } +} Added: trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.resx =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.resx (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/ContainerForm.resx 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizer.cs =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizer.cs (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizer.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,26 @@ +using System; +using System.Diagnostics; +using Microsoft.VisualStudio.DebuggerVisualizers; +using StructureMap; +using StructureMap.DebuggerVisualizers; + +[assembly: DebuggerVisualizer(typeof(ContainerVisualizer), typeof(ContainerVisualizerObjectSource), Target = typeof(Container), Description = "Container Browser")] + +namespace StructureMap.DebuggerVisualizers +{ + + public class ContainerVisualizer : DialogDebuggerVisualizer + { + private IDialogVisualizerService modalService; + + protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) + { + modalService = windowService; + if (modalService == null) throw new NotSupportedException("This debugger does not support modal visualizers"); + + var containerDetail = (ContainerDetail)objectProvider.GetObject(); + var form = new ContainerForm(containerDetail); + modalService.ShowDialog(form); + } + } +} Added: trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizerObjectSource.cs =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizerObjectSource.cs (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/ContainerVisualizerObjectSource.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.VisualStudio.DebuggerVisualizers; +using System.Linq; +using StructureMap.Pipeline; + +namespace StructureMap.DebuggerVisualizers +{ + public class ContainerVisualizerObjectSource : VisualizerObjectSource + { + public override void GetData(object target, Stream outgoingData) + { + var container = target as Container; + if (container == null) throw new InvalidOperationException("This visualizer does not support Type: " + target.GetType().Name); + + var details = BuildContainerDetails(container); + Serialize(outgoingData, details); + } + + public static ContainerDetail BuildContainerDetails(Container container) + { + IList<PluginTypeDetail> pluginTypeDetails = new List<PluginTypeDetail>(); + foreach (var pluginType in container.Model.PluginTypes) + { + IList<InstanceDetail> instances = new List<InstanceDetail>(); + IList<IInstance> usedInstances = new List<IInstance>(); + + if (pluginType.Default != null) + { + instances.Add(buildInstanceDetail(pluginType.Default)); + usedInstances.Add(pluginType.Default); + } + foreach (var instance in pluginType.Instances) + { + if (usedInstances.Contains(instance)) continue; + instances.Add(buildInstanceDetail(instance)); + } + + var pluginTypeDetail = new PluginTypeDetail(pluginType.PluginType, pluginType.Policy.GetType(), instances.ToArray()); + pluginTypeDetails.Add(pluginTypeDetail); + } + + return new ContainerDetail(container.PluginGraph.Log.Sources, pluginTypeDetails.ToArray()); + } + + private static InstanceDetail buildInstanceDetail(IInstance instance) + { + return new InstanceDetail(instance.Name, instance.Description, instance.ConcreteType); + } + } +} \ No newline at end of file Added: trunk/Source/StructureMap.DebuggerVisualizers/DisplayHelper.cs =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/DisplayHelper.cs (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/DisplayHelper.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,30 @@ +using System; +using System.Linq; + +namespace StructureMap.DebuggerVisualizers +{ + public static class DisplayHelper + { + public static string AsCSharp(this Type type) + { + return type.AsCSharp(t => t.Name); + } + public static string AsCSharp(this Type type, Func<Type, string> selector) + { + var typeName = selector(type) ?? string.Empty; + if (type.IsGenericType) + { + var genericParamSelector = type.IsGenericTypeDefinition ? t => t.Name : selector; + var genericTypeList = String.Join(",", type.GetGenericArguments().Select(genericParamSelector).ToArray()); + var tickLocation = typeName.IndexOf('`'); + if (tickLocation >= 0) + { + typeName = typeName.Substring(0, tickLocation); + } + return string.Format("{0}<{1}>", typeName, genericTypeList); + } + return typeName; + } + + } +} Added: trunk/Source/StructureMap.DebuggerVisualizers/Properties/AssemblyInfo.cs =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/Properties/AssemblyInfo.cs (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/Properties/AssemblyInfo.cs 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,4 @@ +using System.Reflection; + +[assembly: AssemblyTitle("StructureMap.DebuggerVisualizers")] +[assembly: AssemblyDescription("Enhances the Visual Studio debugger to provide better support for StructureMap types.")] Added: trunk/Source/StructureMap.DebuggerVisualizers/StructureMap.DebuggerVisualizers.csproj =================================================================== --- trunk/Source/StructureMap.DebuggerVisualizers/StructureMap.DebuggerVisualizers.csproj (rev 0) +++ trunk/Source/StructureMap.DebuggerVisualizers/StructureMap.DebuggerVisualizers.csproj 2008-12-17 16:41:58 UTC (rev 198) @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{F023DA4D-0B7D-4836-A56A-21F22A0A2D71}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>StructureMap.DebuggerVisualizers</RootNamespace> + <AssemblyName>StructureMap.DebuggerVisualizers</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <SignAssembly>true</SignAssembly> + <AssemblyOriginatorKeyFile>..\structuremap.snk</AssemblyOriginatorKeyFile> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.VisualStudio.DebuggerVisualizers, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="..\CommonAssemblyInfo.cs"> + <Link>CommonAssemblyInfo.cs</Link> + </Compile> + <Compile Include="ContainerForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="ContainerForm.Designer.cs"> + <DependentUpon>ContainerForm.cs</DependentUpon> + </Compile> + <Compile Include="ContainerVisualizer.cs" /> + <Compile Include="ContainerVisualizerObjectSource.cs" /> + <Compile Include="ContainerDetail.cs" /> + <Compile Include="DisplayHelper.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\StructureMap\StructureMap.csproj"> + <Project>{3F36EA80-2F9A-4DAD-BA27-5AC6163A2EE3}</Project> + <Name>StructureMap</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ContainerForm.resx"> + <DependentUpon>ContainerForm.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <None Include="..\structuremap.snk"> + <Link>Properties\structuremap.snk</Link> + </None> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Deleted: trunk/Source/StructureMap.lnk =================================================================== (Binary files differ) Modified: trunk/Source/StructureMap.sln =================================================================== --- trunk/Source/StructureMap.sln 2008-12-17 04:35:54 UTC (rev 197) +++ trunk/Source/StructureMap.sln 2008-12-17 16:41:58 UTC (rev 198) @@ -53,6 +53,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTML", "HTML\HTML.csproj", "{A6358895-641F-4CC2-BE8E-C61EBE1DBEB9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureMap.DebuggerVisualizers", "StructureMap.DebuggerVisualizers\StructureMap.DebuggerVisualizers.csproj", "{F023DA4D-0B7D-4836-A56A-21F22A0A2D71}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureMap.DebuggerVisualizers.Testing", "StructureMap.DebuggerVisualizers.Testing\StructureMap.DebuggerVisualizers.Testing.csproj", "{13C368E6-A7BE-46E8-8CFB-64010C825748}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Build|.NET = Build|.NET @@ -243,6 +247,36 @@ {A6358895-641F-4CC2-BE8E-C61EBE1DBEB9}.Release|Any CPU.ActiveCfg = Release|Any CPU {A6358895-641F-4CC2-BE8E-C61EBE1DBEB9}.Release|Any CPU.Build.0 = Release|Any CPU {A6358895-641F-4CC2-BE8E-C61EBE1DBEB9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Build|.NET.ActiveCfg = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Build|Any CPU.ActiveCfg = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Build|Any CPU.Build.0 = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Build|Mixed Platforms.ActiveCfg = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Build|Mixed Platforms.Build.0 = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Debug|.NET.ActiveCfg = Debug|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Release|.NET.ActiveCfg = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Release|Any CPU.Build.0 = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F023DA4D-0B7D-4836-A56A-21F22A0A2D71}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Build|.NET.ActiveCfg = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Build|Any CPU.ActiveCfg = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Build|Any CPU.Build.0 = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Build|Mixed Platforms.ActiveCfg = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Build|Mixed Platforms.Build.0 = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Debug|.NET.ActiveCfg = Debug|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Debug|Any CPU.Build.0 = Debug|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Release|.NET.ActiveCfg = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Release|Any CPU.ActiveCfg = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Release|Any CPU.Build.0 = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {13C368E6-A7BE-46E8-8CFB-64010C825748}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2008-12-17 04:35:54 UTC (rev 197) +++ trunk/cruise.build 2008-12-17 16:41:58 UTC (rev 198) @@ -48,11 +48,12 @@ <attributes> <attribute type="ComVisibleAttribute" value="false" /> <attribute type="AssemblyVersionAttribute" value="${assembly-version}" /> - <attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2007, Jeremy D. Miller" /> + <attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2003-2008, Jeremy D. Miller" /> <attribute type="AssemblyProductAttribute" value="StructureMap" /> <attribute type="AssemblyCompanyAttribute" value="" /> <attribute type="AssemblyConfigurationAttribute" value="${project.config}" /> <attribute type="AssemblyInformationalVersionAttribute" value="${assembly-version}" /> + <attribute type="AssemblyFileVersionAttribute" value="${assembly-version}" /> </attributes> <references> <include name="System.dll" /> @@ -100,9 +101,12 @@ <exec program="${nunit-console.exe}" workingdir="${build.dir}"> <arg value="StructureMap.Testing.dll" /> </exec> + <exec program="${nunit-console.exe}" workingdir="${build.dir}"> + <arg value="StructureMap.DebuggerVisualizers.Testing.exe" /> + </exec> - - </target> + + </target> <target name="runDoctor"> <echo message="Running StructureMapDoctor" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2008-12-19 05:04:55
|
Revision: 200 http://structuremap.svn.sourceforge.net/structuremap/?rev=200&view=rev Author: flimflan Date: 2008-12-19 05:04:53 +0000 (Fri, 19 Dec 2008) Log Message: ----------- Added AutoMocking support for Moq Modified Paths: -------------- trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs trunk/Source/StructureMap.AutoMocking/ServiceLocator.cs trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj Added Paths: ----------- trunk/Source/StructureMap.AutoMocking/MoqAutoMocker.cs trunk/Source/StructureMap.AutoMocking/MoqFactory.cs trunk/Source/StructureMap.Testing/AutoMocking/AutoMockerTester.cs trunk/Source/StructureMap.Testing/AutoMocking/MoqAutoMockerTester.cs trunk/Source/StructureMap.Testing/AutoMocking/MoqFactoryTester.cs trunk/bin/Moq.dll Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - build results push.bat + build results push.bat deploy TestResult.xml Copied: trunk/Source/StructureMap.AutoMocking/MoqAutoMocker.cs (from rev 199, trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs) =================================================================== --- trunk/Source/StructureMap.AutoMocking/MoqAutoMocker.cs (rev 0) +++ trunk/Source/StructureMap.AutoMocking/MoqAutoMocker.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -0,0 +1,15 @@ +namespace StructureMap.AutoMocking +{ + /// <summary> + /// Provides an "Auto Mocking Container" for the concrete class TARGETCLASS using Moq + /// </summary> + /// <typeparam name="TARGETCLASS">The concrete class being tested</typeparam> + public class MoqAutoMocker<TARGETCLASS> : AutoMocker<TARGETCLASS> where TARGETCLASS : class + { + public MoqAutoMocker() + { + _serviceLocator = new MoqServiceLocator(); + _container = new AutoMockedContainer(_serviceLocator); + } + } +} \ No newline at end of file Property changes on: trunk/Source/StructureMap.AutoMocking/MoqAutoMocker.cs ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/Source/StructureMap.AutoMocking/MoqFactory.cs (from rev 199, trunk/Source/StructureMap.AutoMocking/RhinoMockRepositoryProxy.cs) =================================================================== --- trunk/Source/StructureMap.AutoMocking/MoqFactory.cs (rev 0) +++ trunk/Source/StructureMap.AutoMocking/MoqFactory.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -0,0 +1,36 @@ +using System; +using System.Reflection; + +namespace StructureMap.AutoMocking +{ + public class MoqFactory + { + private readonly Type mockOpenType; + + public MoqFactory() + { + var Moq = Assembly.Load("Moq"); + mockOpenType = Moq.GetType("Moq.Mock`1"); + if (mockOpenType == null) throw new InvalidOperationException("Unable to find Type Moq.Mock<T> in assembly " + Moq.Location); + } + + public object CreateMock(Type type) + { + var closedType = mockOpenType.MakeGenericType(new[] {type}); + var objectProperty = closedType.GetProperty("Object", type); + var instance = Activator.CreateInstance(closedType); + return objectProperty.GetValue(instance, null); + } + + public object CreateMockThatCallsBase(Type type, object[] args) + { + var closedType = mockOpenType.MakeGenericType(new[] { type }); + var callBaseProperty = closedType.GetProperty("CallBase", typeof(bool)); + var objectProperty = closedType.GetProperty("Object", type); + var constructor = closedType.GetConstructor(new[]{typeof(object[])}); + var instance = constructor.Invoke(new[]{args}); + callBaseProperty.SetValue(instance, true, null); + return objectProperty.GetValue(instance, null); + } + } +} \ No newline at end of file Property changes on: trunk/Source/StructureMap.AutoMocking/MoqFactory.cs ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs =================================================================== --- trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs 2008-12-19 02:41:25 UTC (rev 199) +++ trunk/Source/StructureMap.AutoMocking/RhinoAutoMocker.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -9,7 +9,7 @@ public enum MockMode { RecordAndReplay, AAA } /// <summary> - /// Provides an "Auto Mocking Container" for the concrete class TARGETCLASS + /// Provides an "Auto Mocking Container" for the concrete class TARGETCLASS using Rhino.Mocks /// </summary> /// <typeparam name="TARGETCLASS">The concrete class being tested</typeparam> public class RhinoAutoMocker<TARGETCLASS> : AutoMocker<TARGETCLASS> where TARGETCLASS : class Modified: trunk/Source/StructureMap.AutoMocking/ServiceLocator.cs =================================================================== --- trunk/Source/StructureMap.AutoMocking/ServiceLocator.cs 2008-12-19 02:41:25 UTC (rev 199) +++ trunk/Source/StructureMap.AutoMocking/ServiceLocator.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -54,4 +54,24 @@ return instance; } } + + public class MoqServiceLocator : ServiceLocator + { + private readonly MoqFactory _moqs = new MoqFactory(); + + public T Service<T>() where T : class + { + return (T)_moqs.CreateMock(typeof(T)); + } + + public object Service(Type serviceType) + { + return _moqs.CreateMock(serviceType); + } + + public T PartialMock<T>(params object[] args) where T : class + { + return (T)_moqs.CreateMockThatCallsBase(typeof (T), args); + } + } } \ No newline at end of file Modified: trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj =================================================================== --- trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj 2008-12-19 02:41:25 UTC (rev 199) +++ trunk/Source/StructureMap.AutoMocking/StructureMap.AutoMocking.csproj 2008-12-19 05:04:53 UTC (rev 200) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{0ED1B206-A1C9-4A52-BA87-3BA416C8725C}</ProjectGuid> <OutputType>Library</OutputType> @@ -66,6 +66,8 @@ </Compile> <Compile Include="AutoMockedContainer.cs" /> <Compile Include="AutoMocker.cs" /> + <Compile Include="MoqAutoMocker.cs" /> + <Compile Include="MoqFactory.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="RhinoAutoMocker.cs" /> <Compile Include="RhinoMockRepositoryProxy.cs" /> @@ -107,4 +109,4 @@ <Target Name="AfterBuild"> </Target> --> -</Project> +</Project> \ No newline at end of file Copied: trunk/Source/StructureMap.Testing/AutoMocking/AutoMockerTester.cs (from rev 197, trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs) =================================================================== --- trunk/Source/StructureMap.Testing/AutoMocking/AutoMockerTester.cs (rev 0) +++ trunk/Source/StructureMap.Testing/AutoMocking/AutoMockerTester.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -0,0 +1,267 @@ +using System; +using System.Linq.Expressions; +using NUnit.Framework; +using StructureMap.AutoMocking; + +namespace StructureMap.Testing.AutoMocking +{ + [TestFixture] + public abstract class AutoMockerTester + { + protected abstract AutoMocker<T> createAutoMocker<T>() where T : class; + protected abstract void setExpectation<T, TResult>(T mock, Expression<Func<T, TResult>> functionCall, TResult expectedResult) where T : class; + + public class ConcreteThing + { + private readonly IMockedService _service; + private readonly IMockedService2 _service2; + + + public ConcreteThing(IMockedService service, IMockedService2 service2) + { + _service = service; + _service2 = service2; + } + + + public IMockedService Service + { + get { return _service; } + } + + public IMockedService2 Service2 + { + get { return _service2; } + } + } + + public class ConcreteClass + { + private readonly IMockedService _service; + private readonly IMockedService2 _service2; + private readonly IMockedService3 _service3; + + public ConcreteClass(IMockedService service, IMockedService2 service2, IMockedService3 service3) + { + _service = service; + _service2 = service2; + _service3 = service3; + } + + public virtual string Name + { + get { return _service.Name; } + } + + public IMockedService Service + { + get { return _service; } + } + + public IMockedService2 Service2 + { + get { return _service2; } + } + + public IMockedService3 Service3 + { + get { return _service3; } + } + + public void CallService() + { + _service.Go(); + } + } + + public interface IMockedService + { + string Name { get; } + void Go(); + } + + public interface IMockedService2 + { + void Go(); + } + + public interface IMockedService3 + { + void Go(); + } + + + public class StubService : IMockedService + { + private readonly string _name; + + public StubService() + { + } + + public StubService(string name) + { + _name = name; + } + + #region IMockedService Members + + public string Name + { + get { return _name; } + } + + public void Go() + { + throw new NotImplementedException(); + } + + #endregion + } + + public class ClassWithArray + { + private readonly IMockedService[] _services; + + public ClassWithArray(IMockedService[] services) + { + _services = services; + } + + public IMockedService[] Services + { + get { return _services; } + } + } + + [Test] + public void CanInjectAnArrayOfMockServices1() + { + var mocker = createAutoMocker<ClassWithArray>(); + + IMockedService[] services = mocker.CreateMockArrayFor<IMockedService>(3); + ClassWithArray theClass = mocker.ClassUnderTest; + + theClass.Services.Length.ShouldEqual(3); + } + + [Test] + public void CanInjectAnArrayOfMockServices2() + { + var mocker = createAutoMocker<ClassWithArray>(); + + ClassWithArray theClass = mocker.ClassUnderTest; + + theClass.Services.Length.ShouldEqual(0); + } + + + [Test] + public void CanInjectAnArrayOfMockServices3() + { + var mocker = createAutoMocker<ClassWithArray>(); + + IMockedService[] services = mocker.CreateMockArrayFor<IMockedService>(3); + + mocker.PartialMockTheClassUnderTest(); + ClassWithArray theClass = mocker.ClassUnderTest; + + theClass.Services.Length.ShouldEqual(3); + } + + [Test] + public void CanInjectAnArrayOfMockServices4() + { + var mocker = createAutoMocker<ClassWithArray>(); + + mocker.PartialMockTheClassUnderTest(); + ClassWithArray theClass = mocker.ClassUnderTest; + + theClass.Services.Length.ShouldEqual(0); + } + + + [Test] + public void GetTheSameConcreteClassTwiceFromCreate() + { + var autoMocker = createAutoMocker<ConcreteClass>(); + ConcreteClass concreteClass = autoMocker.ClassUnderTest; + + Assert.AreSame(concreteClass, autoMocker.ClassUnderTest); + Assert.AreSame(concreteClass, autoMocker.ClassUnderTest); + Assert.AreSame(concreteClass, autoMocker.ClassUnderTest); + } + + [Test] + public void TheAutoMockerPushesInMocksAndAPreBuiltStubForAllOfTheConstructorArguments() + { + var autoMocker = createAutoMocker<ConcreteClass>(); + var stub = new StubService(); + autoMocker.Inject<IMockedService>(stub); + + var service2 = autoMocker.Get<IMockedService2>(); + var service3 = autoMocker.Get<IMockedService3>(); + + ConcreteClass concreteClass = autoMocker.ClassUnderTest; + + Assert.AreSame(stub, concreteClass.Service); + Assert.AreSame(service2, concreteClass.Service2); + Assert.AreSame(service3, concreteClass.Service3); + } + + [Test] + public void TheAutoMockerPushesInMocksForAllOfTheConstructorArgumentsForAPartialMock() + { + var autoMocker = createAutoMocker<ConcreteClass>(); + + var service = autoMocker.Get<IMockedService>(); + var service2 = autoMocker.Get<IMockedService2>(); + var service3 = autoMocker.Get<IMockedService3>(); + + autoMocker.PartialMockTheClassUnderTest(); + ConcreteClass concreteClass = autoMocker.ClassUnderTest; + + Assert.AreSame(service, concreteClass.Service); + Assert.AreSame(service2, concreteClass.Service2); + Assert.AreSame(service3, concreteClass.Service3); + } + + [Test] + public void UseConcreteClassFor() + { + var mocker = createAutoMocker<ConcreteClass>(); + mocker.UseConcreteClassFor<ConcreteThing>(); + + var thing = mocker.Get<ConcreteThing>(); + Assert.IsInstanceOfType(typeof (ConcreteThing), thing); + + Assert.AreSame(mocker.Get<IMockedService>(), thing.Service); + Assert.AreSame(mocker.Get<IMockedService2>(), thing.Service2); + } + + [Test] + public void UseTheAutoMockerToStartUpTheConcreteClass() + { + var autoMocker = createAutoMocker<ConcreteClass>(); + setExpectation(autoMocker.Get<IMockedService>(), x=> x.Name, "Jeremy"); + autoMocker.ClassUnderTest.Name.ShouldEqual("Jeremy"); + } + + [Test] + public void UseTheAutoMockerToStartUpTheConcreteClassAsAPartialMockAndSetTheNameMethodUp() + { + var autoMocker = createAutoMocker<ConcreteClass>(); + + autoMocker.PartialMockTheClassUnderTest(); + ConcreteClass concreteClass = autoMocker.ClassUnderTest; + setExpectation(concreteClass, x=> x.Name, "Max"); + concreteClass.Name.ShouldEqual("Max"); + } + + public interface IAnotherService + { + + } + + } +} \ No newline at end of file Property changes on: trunk/Source/StructureMap.Testing/AutoMocking/AutoMockerTester.cs ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/Source/StructureMap.Testing/AutoMocking/MoqAutoMockerTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/AutoMocking/MoqAutoMockerTester.cs (rev 0) +++ trunk/Source/StructureMap.Testing/AutoMocking/MoqAutoMockerTester.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -0,0 +1,22 @@ +using System; +using Moq; +using NUnit.Framework; +using StructureMap.AutoMocking; +using System.Linq.Expressions; + +namespace StructureMap.Testing.AutoMocking +{ + [TestFixture] + public class MoqAutoMockerTester : AutoMockerTester + { + protected override AutoMocker<T> createAutoMocker<T>() + { + return new MoqAutoMocker<T>(); + } + + protected override void setExpectation<T, TResult>(T mock, Expression<Func<T, TResult>> functionCall, TResult expectedResult) + { + Mock.Get(mock).Expect(functionCall).Returns(expectedResult); + } + } +} Copied: trunk/Source/StructureMap.Testing/AutoMocking/MoqFactoryTester.cs (from rev 199, trunk/Source/StructureMap.Testing/AutoMocking/RhinoMockRepositoryProxyTester.cs) =================================================================== --- trunk/Source/StructureMap.Testing/AutoMocking/MoqFactoryTester.cs (rev 0) +++ trunk/Source/StructureMap.Testing/AutoMocking/MoqFactoryTester.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -0,0 +1,46 @@ +using Moq; +using NUnit.Framework; +using StructureMap.AutoMocking; + +namespace StructureMap.Testing.AutoMocking +{ + [TestFixture] + public class MoqFactoryTester + { + + [Test] + public void sample_moq_usage() + { + var mock = new Mock<ITestMocks>(); + mock.Expect(t => t.Answer()).Returns("Moq"); + mock.Object.Answer().ShouldEqual("Moq"); + } + + [Test] + public void can_make_dynamic_mocks() + { + var moqFactory = new MoqFactory(); + var fooMock = moqFactory.CreateMock(typeof(ITestMocks)); + + fooMock.ShouldNotBeNull(); + } + + [Test] + public void can_make_partial_mocks() + { + var moqFactory = new MoqFactory(); + var testPartials = (TestPartials)moqFactory.CreateMockThatCallsBase(typeof(TestPartials), new object[0]); + + testPartials.ShouldNotBeNull(); + testPartials.Concrete().ShouldEqual("Concrete"); + testPartials.Virtual().ShouldEqual("Virtual"); + + var mock = Mock.Get(testPartials); + mock.Expect(t => t.Virtual()).Returns("MOQed!"); + testPartials.Virtual().ShouldEqual("MOQed!"); + } + + } + + +} \ No newline at end of file Property changes on: trunk/Source/StructureMap.Testing/AutoMocking/MoqFactoryTester.cs ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs 2008-12-19 02:41:25 UTC (rev 199) +++ trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs 2008-12-19 05:04:53 UTC (rev 200) @@ -1,4 +1,5 @@ using System; +using System.Linq.Expressions; using NUnit.Framework; using Rhino.Mocks; using Rhino.Mocks.Interfaces; @@ -8,7 +9,7 @@ namespace StructureMap.Testing.AutoMocking { [TestFixture] - public class RhinoAutoMockerTester + public class RhinoAutoMockerTester : AutoMockerTester { #region Setup/Teardown @@ -26,130 +27,16 @@ private RhinoMocksAAAServiceLocator _locator; private AutoMockedContainer _container; - - public class ConcreteThing + protected override AutoMocker<T> createAutoMocker<T>() { - private readonly IMockedService _service; - private readonly IMockedService2 _service2; - - - public ConcreteThing(IMockedService service, IMockedService2 service2) - { - _service = service; - _service2 = service2; - } - - - public IMockedService Service - { - get { return _service; } - } - - public IMockedService2 Service2 - { - get { return _service2; } - } + return new RhinoAutoMocker<T>(); } - public class ConcreteClass + protected override void setExpectation<T,TResult>(T mock, Expression<Func<T,TResult>> functionCall, TResult expectedResult) { - private readonly IMockedService _service; - private readonly IMockedService2 _service2; - private readonly IMockedService3 _service3; - - public ConcreteClass(IMockedService service, IMockedService2 service2, IMockedService3 service3) - { - _service = service; - _service2 = service2; - _service3 = service3; - } - - public virtual string Name - { - get { return _service.Name; } - } - - public IMockedService Service - { - get { return _service; } - } - - public IMockedService2 Service2 - { - get { return _service2; } - } - - public IMockedService3 Service3 - { - get { return _service3; } - } - - public void CallService() - { - _service.Go(); - } + mock.Expect(x => functionCall.Compile()(mock)).Return(expectedResult); } - public interface IMockedService - { - string Name { get; } - void Go(); - } - - public interface IMockedService2 - { - void Go(); - } - - public interface IMockedService3 - { - void Go(); - } - - - public class StubService : IMockedService - { - private readonly string _name; - - public StubService() - { - } - - public StubService(string name) - { - _name = name; - } - - #region IMockedService Members - - public string Name - { - get { return _name; } - } - - public void Go() - { - throw new NotImplementedException(); - } - - #endregion - } - - public class ClassWithArray - { - private readonly IMockedService[] _services; - - public ClassWithArray(IMockedService[] services) - { - _services = services; - } - - public IMockedService[] Services - { - get { return _services; } - } - } - [Test] public void AutoFillAConcreteClassWithMocks() { @@ -164,54 +51,8 @@ Assert.AreSame(service3, concreteClass.Service3); } - [Test] - public void CanInjectAnArrayOfMockServices1() - { - var mocker = new RhinoAutoMocker<ClassWithArray>(); - IMockedService[] services = mocker.CreateMockArrayFor<IMockedService>(3); - ClassWithArray theClass = mocker.ClassUnderTest; - - theClass.Services.Length.ShouldEqual(3); - } - [Test] - public void CanInjectAnArrayOfMockServices2() - { - var mocker = new RhinoAutoMocker<ClassWithArray>(); - - ClassWithArray theClass = mocker.ClassUnderTest; - - theClass.Services.Length.ShouldEqual(0); - } - - - [Test] - public void CanInjectAnArrayOfMockServices3() - { - var mocker = new RhinoAutoMocker<ClassWithArray>(); - - IMockedService[] services = mocker.CreateMockArrayFor<IMockedService>(3); - - mocker.PartialMockTheClassUnderTest(); - ClassWithArray theClass = mocker.ClassUnderTest; - - theClass.Services.Length.ShouldEqual(3); - } - - [Test] - public void CanInjectAnArrayOfMockServices4() - { - var mocker = new RhinoAutoMocker<ClassWithArray>(); - - mocker.PartialMockTheClassUnderTest(); - ClassWithArray theClass = mocker.ClassUnderTest; - - theClass.Services.Length.ShouldEqual(0); - } - - - [Test] public void GetAFullMockForAServiceThatHasNotPreviouslyBeenRequested() { var service = _container.GetInstance<IMockedService>(); @@ -219,17 +60,6 @@ } [Test] - public void GetTheSameConcreteClassTwiceFromCreate() - { - var autoMocker = new RhinoAutoMocker<ConcreteClass>(); - ConcreteClass concreteClass = autoMocker.ClassUnderTest; - - Assert.AreSame(concreteClass, autoMocker.ClassUnderTest); - Assert.AreSame(concreteClass, autoMocker.ClassUnderTest); - Assert.AreSame(concreteClass, autoMocker.ClassUnderTest); - } - - [Test] public void InjectAStubAndGetTheStubBack() { var stub = new StubService(); @@ -250,76 +80,8 @@ Assert.AreSame(service, _container.GetInstance<IMockedService>()); } - [Test] - public void TheAutoMockerPushesInMocksAndAPreBuiltStubForAllOfTheConstructorArguments() - { - var autoMocker = new RhinoAutoMocker<ConcreteClass>(); - var stub = new StubService(); - autoMocker.Inject<IMockedService>(stub); - var service2 = autoMocker.Get<IMockedService2>(); - var service3 = autoMocker.Get<IMockedService3>(); - - ConcreteClass concreteClass = autoMocker.ClassUnderTest; - - Assert.AreSame(stub, concreteClass.Service); - Assert.AreSame(service2, concreteClass.Service2); - Assert.AreSame(service3, concreteClass.Service3); - } - [Test] - public void TheAutoMockerPushesInMocksForAllOfTheConstructorArgumentsForAPartialMock() - { - var autoMocker = new RhinoAutoMocker<ConcreteClass>(); - - var service = autoMocker.Get<IMockedService>(); - var service2 = autoMocker.Get<IMockedService2>(); - var service3 = autoMocker.Get<IMockedService3>(); - - autoMocker.PartialMockTheClassUnderTest(); - ConcreteClass concreteClass = autoMocker.ClassUnderTest; - - Assert.AreSame(service, concreteClass.Service); - Assert.AreSame(service2, concreteClass.Service2); - Assert.AreSame(service3, concreteClass.Service3); - } - - [Test] - public void UseConcreteClassFor() - { - var mocker = new RhinoAutoMocker<ConcreteClass>(); - mocker.UseConcreteClassFor<ConcreteThing>(); - - var thing = mocker.Get<ConcreteThing>(); - Assert.IsInstanceOfType(typeof (ConcreteThing), thing); - - Assert.AreSame(mocker.Get<IMockedService>(), thing.Service); - Assert.AreSame(mocker.Get<IMockedService2>(), thing.Service2); - } - - [Test] - public void UseTheAutoMockerToStartUpTheConcreteClass() - { - var autoMocker = new RhinoAutoMocker<ConcreteClass>(); - - autoMocker.Get<IMockedService>().Expect(x => x.Name).Return("Jeremy"); - - autoMocker.ClassUnderTest.Name.ShouldEqual("Jeremy"); - } - - [Test] - public void UseTheAutoMockerToStartUpTheConcreteClassAsAPartialMockAndSetTheNameMethodUp() - { - var autoMocker = new RhinoAutoMocker<ConcreteClass>(); - - autoMocker.PartialMockTheClassUnderTest(); - ConcreteClass concreteClass = autoMocker.ClassUnderTest; - - concreteClass.Expect(x => x.Name).Return("Max"); - concreteClass.Name.ShouldEqual("Max"); - } - - [Test] public void TheAutoMockerOptionallyPushesInMocksInReplayModeToAllowForAAAsyntax() { var autoMocker = new RhinoAutoMocker<ConcreteClass>(MockMode.AAA); Modified: trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj =================================================================== --- trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj 2008-12-19 02:41:25 UTC (rev 199) +++ trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj 2008-12-19 05:04:53 UTC (rev 200) @@ -1,7 +1,7 @@ <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{63C2742D-B6E2-484F-AFDB-346873075C5E}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -91,6 +91,10 @@ <ErrorReport>prompt</ErrorReport> </PropertyGroup> <ItemGroup> + <Reference Include="Moq, Version=2.6.1014.1, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\bin\Moq.dll</HintPath> + </Reference> <Reference Include="nunit.framework, Version=2.2.6.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\bin\NUnit\nunit.framework.dll</HintPath> @@ -169,6 +173,9 @@ <Compile Include="Attributes\PluginFamilyAttributeTester.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="AutoMocking\AutoMockerTester.cs" /> + <Compile Include="AutoMocking\MoqAutoMockerTester.cs" /> + <Compile Include="AutoMocking\MoqFactoryTester.cs" /> <Compile Include="AutoMocking\RhinoAutoMockerTester.cs" /> <Compile Include="AutoMocking\RhinoMockRepositoryProxyTester.cs" /> <Compile Include="BuildSessionTester.cs" /> @@ -446,4 +453,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Added: trunk/bin/Moq.dll =================================================================== (Binary files differ) Property changes on: trunk/bin/Moq.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jer...@us...> - 2009-01-03 00:07:37
|
Revision: 214 http://structuremap.svn.sourceforge.net/structuremap/?rev=214&view=rev Author: jeremydmiller Date: 2009-01-03 00:07:32 +0000 (Sat, 03 Jan 2009) Log Message: ----------- Missing Instance, BuildUp, documentation, conditional instance Modified Paths: -------------- trunk/Docs/style.css trunk/Source/CommonAssemblyInfo.cs trunk/Source/StructureMap/BuildSession.cs trunk/Source/StructureMap/Configuration/DSL/Expressions/CreatePluginFamilyExpression.cs trunk/Source/StructureMap/Configuration/DSL/Expressions/InstanceExpression.cs trunk/Source/StructureMap/Configuration/DSL/Registry.cs trunk/Source/StructureMap/ConfigurationExpression.cs trunk/Source/StructureMap/Container.cs trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs trunk/Source/StructureMap/ExplicitArgsExpression.cs trunk/Source/StructureMap/Graph/Constructor.cs trunk/Source/StructureMap/Graph/Plugin.cs trunk/Source/StructureMap/Graph/PluginCache.cs trunk/Source/StructureMap/Graph/PluginFamily.cs trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs trunk/Source/StructureMap/IContainer.cs trunk/Source/StructureMap/IInstanceFactory.cs trunk/Source/StructureMap/InitializationExpression.cs trunk/Source/StructureMap/InstanceBuilder.cs trunk/Source/StructureMap/InstanceFactory.cs trunk/Source/StructureMap/ObjectFactory.cs trunk/Source/StructureMap/Pipeline/BuildFrame.cs trunk/Source/StructureMap/ReflectionHelper.cs trunk/Source/StructureMap/StructureMap.csproj trunk/Source/StructureMap/SystemRegistry.cs trunk/Source/StructureMap.Testing/Configuration/DSL/AddInstanceTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/CreatePluginFamilyTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/GenericFamilyExpressionTester.cs trunk/Source/StructureMap.Testing/Examples/RegisteringWithTheAPI.cs trunk/Source/StructureMap.Testing/Examples.cs trunk/Source/StructureMap.Testing/Graph/ContainerTester.cs trunk/Source/StructureMap.Testing/Graph/InstanceFactoryTester.cs trunk/Source/StructureMap.Testing/Graph/PluginTester.cs trunk/Source/StructureMap.Testing/Graph/TestExplicitArguments.cs trunk/Source/StructureMap.Testing/Pipeline/OptionalSetterInjectionTester.cs trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj trunk/Source/StructureMap.Testing.Widget/BuilderSamples.cs trunk/Source/StructureMap.Testing.Widget3/IService.cs trunk/cruise.build Added Paths: ----------- trunk/Source/StructureMap/Configuration/DSL/SetterConvention.cs trunk/Source/StructureMap/Emitting/BuildUpMethod.cs trunk/Source/StructureMap/Pipeline/ConditionalInstance.cs trunk/Source/StructureMap.Testing/AutoWiringExamples.cs trunk/Source/StructureMap.Testing/Bugs/SingletonShouldBeLazy.cs trunk/Source/StructureMap.Testing/BuildUpIntegratedTester.cs trunk/Source/StructureMap.Testing/BuildUpTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/ProgrammaticConstructorSelectionTester.cs trunk/Source/StructureMap.Testing/Examples/CustomInstance.cs trunk/Source/StructureMap.Testing/Graph/ConventionBasedSetterInjectionTester.cs trunk/Source/StructureMap.Testing/Pipeline/ConditionalInstanceTester.cs trunk/Source/StructureMap.Testing/Pipeline/MissingInstanceTester.cs trunk/Source/StructureMap.Testing/PrimitiveArrayTester.cs Modified: trunk/Docs/style.css =================================================================== --- trunk/Docs/style.css 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Docs/style.css 2009-01-03 00:07:32 UTC (rev 214) @@ -16,7 +16,8 @@ } H2 { - COLOR: #316592; + BACKGROUND-COLOR: #316592; + COLOR: white; FONT-FAMILY: Arial; FONT-SIZE: large; FONT-WEIGHT: bold; Modified: trunk/Source/CommonAssemblyInfo.cs =================================================================== --- trunk/Source/CommonAssemblyInfo.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/CommonAssemblyInfo.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -5,7 +5,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.1434 +// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Modified: trunk/Source/StructureMap/BuildSession.cs =================================================================== --- trunk/Source/StructureMap/BuildSession.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/BuildSession.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -25,6 +25,24 @@ /// <typeparam name="T"></typeparam> /// <returns></returns> T GetInstance<T>(); + + /// <summary> + /// Gets the root "frame" of the object request + /// </summary> + BuildFrame Root { get; } + + /// <summary> + /// The requested instance name of the object graph + /// </summary> + string RequestedName { get; } + + /// <summary> + /// Register a default object for the given PluginType that will + /// be used throughout the rest of the current object request + /// </summary> + /// <param name="pluginType"></param> + /// <param name="defaultObject"></param> + void RegisterDefault(Type pluginType, object defaultObject); } public class BuildSession : IContext @@ -63,6 +81,8 @@ } + public string RequestedName { get; set; } + protected PipelineGraph pipelineGraph { get { return _pipelineGraph; } @@ -85,6 +105,11 @@ return (T) CreateInstance(typeof (T)); } + BuildFrame IContext.Root + { + get { return _buildStack.Root; } + } + #endregion public virtual object CreateInstance(Type pluginType, string name) @@ -112,6 +137,7 @@ return result; } + public virtual Array CreateInstanceArray(Type pluginType, Instance[] instances) { Array array; Modified: trunk/Source/StructureMap/Configuration/DSL/Expressions/CreatePluginFamilyExpression.cs =================================================================== --- trunk/Source/StructureMap/Configuration/DSL/Expressions/CreatePluginFamilyExpression.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Configuration/DSL/Expressions/CreatePluginFamilyExpression.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -38,6 +38,14 @@ get { return new InstanceExpression<PLUGINTYPE>(i => registerDefault(i)); } } + public InstanceExpression<PLUGINTYPE> MissingNamedInstanceIs + { + get + { + return new InstanceExpression<PLUGINTYPE>(i => _alterations.Add(family => family.MissingInstance = i)); + } + } + /// <summary> /// Add multiple Instance's to this PluginType /// </summary> Modified: trunk/Source/StructureMap/Configuration/DSL/Expressions/InstanceExpression.cs =================================================================== --- trunk/Source/StructureMap/Configuration/DSL/Expressions/InstanceExpression.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Configuration/DSL/Expressions/InstanceExpression.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -28,6 +28,11 @@ LiteralInstance IsThis(T obj); } + public interface ThenItExpression<T> + { + IsExpression<T> ThenIt { get; } + } + /// <summary> /// An Expression Builder to define Instances of a PluginType. /// This is mostly used for configuring open generic types @@ -178,9 +183,17 @@ /// <param name="url"></param> /// <returns></returns> UserControlInstance LoadControlFrom(string url); + + /// <summary> + /// Creates an Instance according to conditional rules + /// </summary> + /// <param name="configuration"></param> + /// <returns></returns> + // Conditional object construction + ConditionalInstance<T> Conditional(Action<ConditionalInstance<T>.ConditionalInstanceExpression<T>> configuration); } - public class InstanceExpression<T> : IInstanceExpression<T> + public class InstanceExpression<T> : IInstanceExpression<T>, ThenItExpression<T> { private readonly Action<Instance> _action; @@ -268,5 +281,15 @@ { return returnInstance(new UserControlInstance(url)); } + + public ConditionalInstance<T> Conditional(Action<ConditionalInstance<T>.ConditionalInstanceExpression<T>> configuration) + { + return returnInstance(new ConditionalInstance<T>(configuration)); + } + + IsExpression<T> ThenItExpression<T>.ThenIt + { + get { return this; } + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Configuration/DSL/Registry.cs =================================================================== --- trunk/Source/StructureMap/Configuration/DSL/Registry.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Configuration/DSL/Registry.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -7,6 +7,37 @@ namespace StructureMap.Configuration.DSL { + public interface IRegistry + { + // Registering Types -- BuildInstancesOf() and ForRequestedType() are Synonyms + CreatePluginFamilyExpression<PLUGINTYPE> BuildInstancesOf<PLUGINTYPE>(); + CreatePluginFamilyExpression<PLUGINTYPE> ForRequestedType<PLUGINTYPE>(); + + GenericFamilyExpression ForRequestedType(Type pluginType); + + // Shortcut for configuring the default configuration of a concrete type + Registry.BuildWithExpression<T> ForConcreteType<T>(); + + // Adding additional Instances of a PluginType + IsExpression<T> InstanceOf<T>(); + GenericIsExpression InstanceOf(Type pluginType); + + // Creating or Adding to a Profile + ProfileExpression CreateProfile(string profileName); + void CreateProfile(string profileName, Action<ProfileExpression> action); + + // Interception + void RegisterInterceptor(TypeInterceptor interceptor); + MatchedTypeInterceptor IfTypeMatches(Predicate<Type> match); + + // Type Scanning and Auto Registration + void Scan(Action<IAssemblyScanner> action); + + // Controlling Setter Injection Behavior + CreatePluginFamilyExpression<PLUGINTYPE> FillAllPropertiesOfType<PLUGINTYPE>(); + void SetAllProperties(Action<SetterConvention> action); + } + /// <summary> /// 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. @@ -20,7 +51,7 @@ /// } /// } /// </example> - public class Registry + public class Registry : IRegistry { private readonly List<Action<PluginGraph>> _actions = new List<Action<PluginGraph>>(); private readonly List<Action> _basicActions = new List<Action>(); @@ -79,7 +110,6 @@ /// Scoping, the Default Instance, and interception. This method is specifically /// meant for registering open generic types /// </summary> - /// <typeparam name="PLUGINTYPE"></typeparam> /// <returns></returns> public GenericFamilyExpression ForRequestedType(Type pluginType) { @@ -182,6 +212,11 @@ internal static bool IsPublicRegistry(Type type) { + if (type.Assembly == typeof(Registry).Assembly) + { + return false; + } + if (!typeof (Registry).IsAssignableFrom(type)) { return false; @@ -291,5 +326,16 @@ } #endregion + + /// <summary> + /// Creates automatic "policies" for which public setters are considered mandatory + /// properties by StructureMap that will be "setter injected" as part of the + /// construction process. + /// </summary> + /// <param name="action"></param> + public void SetAllProperties(Action<SetterConvention> action) + { + action(new SetterConvention()); + } } } \ No newline at end of file Added: trunk/Source/StructureMap/Configuration/DSL/SetterConvention.cs =================================================================== --- trunk/Source/StructureMap/Configuration/DSL/SetterConvention.cs (rev 0) +++ trunk/Source/StructureMap/Configuration/DSL/SetterConvention.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -0,0 +1,63 @@ +using System; +using System.Reflection; +using StructureMap.Graph; +using StructureMap; + +namespace StructureMap.Configuration.DSL +{ + /// <summary> + /// Used as an expression builder to specify setter injection policies + /// </summary> + public class SetterConvention + { + /// <summary> + /// Directs StructureMap to treat all public setters of type T as + /// mandatory properties + /// </summary> + /// <typeparam name="T"></typeparam> + public void OfType<T>() + { + Matching(prop => prop.PropertyType == typeof (T)); + } + + /// <summary> + /// Directs StructureMap to treat all public setters that match the + /// rule as mandatory properties + /// </summary> + /// <param name="rule"></param> + public void Matching(Predicate<PropertyInfo> rule) + { + PluginCache.UseSetterRule(rule); + } + + /// <summary> + /// Directs StructureMap to treat all public setters with a property + /// type in the specified namespace as mandatory properties + /// </summary> + /// <param name="nameSpace"></param> + public void WithAnyTypeFromNamespace(string nameSpace) + { + Matching(prop => prop.PropertyType.IsInNamespace(nameSpace)); + } + + /// <summary> + /// Directs StructureMap to treat all public setters with a property + /// type in the specified namespace as mandatory properties + /// </summary> + /// <typeparam name="T"></typeparam> + public void WithAnyTypeFromNamespaceContainingType<T>() + { + WithAnyTypeFromNamespace(typeof(T).Namespace); + } + + /// <summary> + /// Directs StructureMap to treat all public setters where to property name + /// matches the specified rule as a mandatory property + /// </summary> + /// <param name="rule"></param> + public void NameMatches(Predicate<string> rule) + { + Matching(prop => rule(prop.Name)); + } + } +} \ No newline at end of file Modified: trunk/Source/StructureMap/ConfigurationExpression.cs =================================================================== --- trunk/Source/StructureMap/ConfigurationExpression.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/ConfigurationExpression.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -1,4 +1,6 @@ +using System; using System.Collections.Generic; +using System.Linq.Expressions; using System.Xml; using StructureMap.Configuration; using StructureMap.Configuration.DSL; @@ -83,5 +85,20 @@ return builder.Build(); } + + /// <summary> + /// Use to programmatically select the constructor function of a concrete + /// class. Applies globally to all Containers in a single AppDomain. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="func"></param> + public void SelectConstructor<T>(Expression<Func<T>> expression) + { + PluginCache.GetPlugin(typeof (T)).UseConstructor(expression); + } } + + + + } \ No newline at end of file Modified: trunk/Source/StructureMap/Container.cs =================================================================== --- trunk/Source/StructureMap/Container.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Container.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -40,7 +40,6 @@ /// </summary> /// <param name="pluginGraph">PluginGraph containing the instance and type definitions /// for the Container</param> - /// <param name="failOnException">Flags the Container to fail or trap exceptions</param> public Container(PluginGraph pluginGraph) { construct(pluginGraph); @@ -80,7 +79,6 @@ /// <summary> /// Creates a new instance of the requested type T using the supplied Instance. Mostly used internally /// </summary> - /// <param name="pluginType"></param> /// <param name="instance"></param> /// <returns></returns> public T GetInstance<T>(Instance instance) @@ -91,7 +89,6 @@ /// <summary> /// Gets the default instance of the pluginType using the explicitly configured arguments from the "args" /// </summary> - /// <param name="pluginType"></param> /// <param name="args"></param> /// <returns></returns> public PLUGINTYPE GetInstance<PLUGINTYPE>(ExplicitArguments args) @@ -117,7 +114,7 @@ BasicInstance basicInstance = defaultInstance as BasicInstance; Instance instance = basicInstance == null ? defaultInstance : new ExplicitInstance(pluginType, args, basicInstance); - BuildSession session = withNewSession(); + BuildSession session = withNewSession(Plugin.DEFAULT); args.RegisterDefaults(session); @@ -128,12 +125,12 @@ /// <summary> /// Gets all configured instances of type T using explicitly configured arguments from the "args" /// </summary> - /// <typeparam name="T"></typeparam> + /// <param name="type"></param> /// <param name="args"></param> /// <returns></returns> public IList GetAllInstances(Type type, ExplicitArguments args) { - BuildSession session = withNewSession(); + BuildSession session = withNewSession(Plugin.DEFAULT); args.RegisterDefaults(session); @@ -143,7 +140,7 @@ public IList<T> GetAllInstances<T>(ExplicitArguments args) { - BuildSession session = withNewSession(); + BuildSession session = withNewSession(Plugin.DEFAULT); args.RegisterDefaults(session); @@ -185,7 +182,7 @@ /// </summary> /// <typeparam name="T"></typeparam> /// <param name="name"></param> - /// <param name="instance"></param> + /// <param name="stub"></param> public void Inject<T>(string name, T stub) { LiteralInstance instance = new LiteralInstance(stub).WithName(name); @@ -199,7 +196,7 @@ /// <returns></returns> public IList<T> GetAllInstances<T>() { - BuildSession session = withNewSession(); + BuildSession session = withNewSession(Plugin.DEFAULT); return getListOfTypeWithSession<T>(session); } @@ -220,7 +217,7 @@ /// <returns></returns> public object GetInstance(Type pluginType, string instanceKey) { - return withNewSession().CreateInstance(pluginType, instanceKey); + return withNewSession(instanceKey).CreateInstance(pluginType, instanceKey); } /// <summary> @@ -228,7 +225,6 @@ /// </summary> /// <param name="pluginType"></param> /// <param name="instanceKey"></param> - /// <param name="instance"></param> /// <returns></returns> public object TryGetInstance(Type pluginType, string instanceKey) { @@ -241,7 +237,6 @@ /// Creates or finds the default instance of the pluginType. Returns null if the pluginType is not known to the container. /// </summary> /// <param name="pluginType"></param> - /// <param name="instance"></param> /// <returns></returns> public object TryGetInstance(Type pluginType) { @@ -254,7 +249,6 @@ /// Creates or finds the default instance of type T. Returns the default value of T if it is not known to the container. /// </summary> /// <typeparam name="T"></typeparam> - /// <param name="instance"></param> /// <returns></returns> public T TryGetInstance<T>() { @@ -262,10 +256,25 @@ } /// <summary> + /// The "BuildUp" method takes in an already constructed object + /// and uses Setter Injection to push in configured dependencies + /// of that object + /// </summary> + /// <param name="target"></param> + public void BuildUp(object target) + { + var pluggedType = target.GetType(); + IConfiguredInstance instance = _pipelineGraph.GetDefault(pluggedType) as IConfiguredInstance + ?? new ConfiguredInstance(pluggedType); + + var builder = PluginCache.FindBuilder(pluggedType); + builder.BuildUp(instance, withNewSession(Plugin.DEFAULT), target); + } + + /// <summary> /// 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. /// </summary> /// <typeparam name="T"></typeparam> - /// <param name="instance"></param> /// <returns></returns> public T TryGetInstance<T>(string instanceKey) { @@ -279,7 +288,7 @@ /// <returns></returns> public object GetInstance(Type pluginType) { - return withNewSession().CreateInstance(pluginType); + return withNewSession(Plugin.DEFAULT).CreateInstance(pluginType); } @@ -291,7 +300,7 @@ /// <returns></returns> public object GetInstance(Type pluginType, Instance instance) { - return withNewSession().CreateInstance(pluginType, instance); + return withNewSession(instance.Name).CreateInstance(pluginType, instance); } public void SetDefault(Type pluginType, Instance instance) @@ -343,7 +352,7 @@ /// <returns></returns> public IList GetAllInstances(Type pluginType) { - return forType(pluginType).GetAllInstances(withNewSession()); + return forType(pluginType).GetAllInstances(withNewSession(Plugin.DEFAULT)); } /// <summary> @@ -464,9 +473,9 @@ _pipelineGraph.SetDefault(pluginType, instance); } - private BuildSession withNewSession() + private BuildSession withNewSession(string name) { - return new BuildSession(_pipelineGraph, _interceptorLibrary); + return new BuildSession(_pipelineGraph, _interceptorLibrary){RequestedName = name}; } @@ -474,5 +483,7 @@ { return _pipelineGraph.ForType(type); } + + } } \ No newline at end of file Modified: trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Emitting/ArgumentEmitter.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -13,11 +13,13 @@ private readonly PrimitiveParameterEmitter _primitive = new PrimitiveParameterEmitter(); private readonly StringParameterEmitter _string = new StringParameterEmitter(); private readonly ILGenerator ilgen; + private readonly bool _inConstructor = true; - public ArgumentEmitter(ILGenerator ilgen) + public ArgumentEmitter(ILGenerator ilgen, bool inConstructor) { this.ilgen = ilgen; + _inConstructor = inConstructor; } #region IArgumentVisitor Members @@ -82,7 +84,7 @@ } else { - emitter.OptionalSetter(ilgen, property); + emitter.OptionalSetter(ilgen, property, _inConstructor); } } } Modified: trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs =================================================================== --- trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Emitting/BuildInstanceMethod.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -47,7 +47,7 @@ ilgen.DeclareLocal(typeof (bool)); } - var arguments = new ArgumentEmitter(ilgen); + var arguments = new ArgumentEmitter(ilgen, true); _plugin.VisitConstructor(arguments); Added: trunk/Source/StructureMap/Emitting/BuildUpMethod.cs =================================================================== --- trunk/Source/StructureMap/Emitting/BuildUpMethod.cs (rev 0) +++ trunk/Source/StructureMap/Emitting/BuildUpMethod.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Text; +using StructureMap.Graph; +using StructureMap.Pipeline; + +namespace StructureMap.Emitting +{ + public class BuildUpMethod : Method + { + private readonly Plugin _plugin; + + public BuildUpMethod(Plugin plugin) + { + _plugin = plugin; + } + + public override string MethodName + { + get { return "BuildUp"; } + } + + public override Type[] ArgumentList + { + get { return new Type[] { typeof(IConfiguredInstance), typeof(BuildSession) , typeof(object)}; } + } + + public override Type ReturnType + { + get { return typeof(void); } + } + + protected override void Generate(ILGenerator ilgen) + { + ilgen.Emit(OpCodes.Nop); + + ilgen.DeclareLocal(_plugin.PluggedType); + ilgen.DeclareLocal(typeof(bool)); + + ilgen.Emit(OpCodes.Ldarg_3); + ilgen.Emit(OpCodes.Castclass, _plugin.PluggedType); + ilgen.Emit(OpCodes.Stloc_0); + + var arguments = new ArgumentEmitter(ilgen, false); + + _plugin.VisitSetters(arguments); + + ilgen.Emit(OpCodes.Ret); + + } + } +} Modified: trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs =================================================================== --- trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Emitting/InstanceBuilderAssembly.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -88,8 +88,11 @@ { builderClass.AddPluggedTypeGetter(plugin.PluggedType); - var method = new BuildInstanceMethod(plugin); - builderClass.AddMethod(method); + var buildInstanceMethod = new BuildInstanceMethod(plugin); + builderClass.AddMethod(buildInstanceMethod); + + var buildUpMethod = new BuildUpMethod(plugin); + builderClass.AddMethod(buildUpMethod); } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs =================================================================== --- trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Emitting/Parameters/ParameterEmitter.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -29,24 +29,30 @@ public abstract void MandatorySetter(ILGenerator ilgen, PropertyInfo property); - public void OptionalSetter(ILGenerator ilgen, PropertyInfo property) + public void OptionalSetter(ILGenerator ilgen, PropertyInfo property, bool inConstructor) { ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldstr, property.Name); ilgen.Emit(OpCodes.Callvirt, Methods.HAS_PROPERTY); ilgen.Emit(OpCodes.Ldc_I4_0); ilgen.Emit(OpCodes.Ceq); - ilgen.Emit(OpCodes.Stloc_2); - ilgen.Emit(OpCodes.Ldloc_2); + if (inConstructor) + { + ilgen.Emit(OpCodes.Stloc_2); + ilgen.Emit(OpCodes.Ldloc_2); + } + else + { + ilgen.Emit(OpCodes.Stloc_1); + ilgen.Emit(OpCodes.Ldloc_1); + } + + Label label = ilgen.DefineLabel(); - ilgen.Emit(OpCodes.Brtrue_S, label); - MandatorySetter(ilgen, property); - ilgen.Emit(OpCodes.Nop); - ilgen.MarkLabel(label); } } Modified: trunk/Source/StructureMap/ExplicitArgsExpression.cs =================================================================== --- trunk/Source/StructureMap/ExplicitArgsExpression.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/ExplicitArgsExpression.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -85,7 +85,6 @@ /// Gets all configured instances of type T using explicitly configured arguments /// </summary> /// <typeparam name="T"></typeparam> - /// <param name="args"></param> /// <returns></returns> public IList<T> GetAllInstances<T>() { Modified: trunk/Source/StructureMap/Graph/Constructor.cs =================================================================== --- trunk/Source/StructureMap/Graph/Constructor.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Graph/Constructor.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -1,11 +1,12 @@ using System; +using System.Linq.Expressions; using System.Reflection; namespace StructureMap.Graph { public class Constructor : TypeRules { - private readonly ConstructorInfo _ctor; + private ConstructorInfo _ctor; private readonly Type _pluggedType; public Constructor(Type pluggedType) @@ -120,5 +121,19 @@ { return _ctor != null; } + + public void UseConstructor(Expression expression) + { + var finder = new ConstructorFinderVisitor(); + finder.Visit(expression); + + var ctor = finder.Constructor; + if (ctor == null) + { + throw new ApplicationException("Not a valid constructor function"); + } + + _ctor = ctor; + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/Plugin.cs =================================================================== --- trunk/Source/StructureMap/Graph/Plugin.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Graph/Plugin.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq.Expressions; using System.Reflection; using StructureMap.Pipeline; @@ -154,15 +155,14 @@ return templatedPlugin; } - public void SetFilledTypes(IList<Type> types) + public void UseConstructor(Expression expression) { - foreach (SetterProperty setter in _setters) - { - if (types.Contains(setter.Property.PropertyType)) - { - setter.IsMandatory = true; - } - } + _constructor.UseConstructor(expression); } + + public void UseSetterRule(Predicate<PropertyInfo> rule) + { + _setters.UseSetterRule(rule); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/PluginCache.cs =================================================================== --- trunk/Source/StructureMap/Graph/PluginCache.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Graph/PluginCache.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using StructureMap.Emitting; using StructureMap.Util; @@ -9,16 +10,27 @@ public static class PluginCache { private static readonly Cache<Type, InstanceBuilder> _builders; - private static readonly List<Type> _filledTypes = new List<Type>(); private static readonly Cache<Type, Plugin> _plugins; + private static readonly List<Predicate<PropertyInfo>> _setterRules; static PluginCache() { - _plugins = new Cache<Type, Plugin>(t => new Plugin(t)); + _setterRules = new List<Predicate<PropertyInfo>>(); + _plugins = new Cache<Type, Plugin>(t => + { + var plugin = new Plugin(t); + foreach (var rule in _setterRules) + { + plugin.UseSetterRule(rule); + } + + return plugin; + }); + + _builders = new Cache<Type, InstanceBuilder>(t => { Plugin plugin = _plugins[t]; - plugin.SetFilledTypes(_filledTypes); return new InstanceBuilderAssembly(new[] {plugin}).Compile()[0]; }); } @@ -45,11 +57,6 @@ private static void createAndStoreBuilders(IEnumerable<Plugin> plugins) { - foreach (Plugin plugin in plugins) - { - plugin.SetFilledTypes(_filledTypes); - } - var assembly = new InstanceBuilderAssembly(plugins); assembly.Compile().ForEach(b => _builders[b.PluggedType] = b); } @@ -68,6 +75,7 @@ { lock (typeof (PluginCache)) { + _setterRules.Clear(); _builders.Clear(); _plugins.Clear(); } @@ -75,7 +83,14 @@ public static void AddFilledType(Type type) { - _filledTypes.Add(type); + Predicate<PropertyInfo> predicate = prop => prop.PropertyType == type; + UseSetterRule(predicate); } + + public static void UseSetterRule(Predicate<PropertyInfo> predicate) + { + _setterRules.Add(predicate); + _plugins.Each(plugin => plugin.UseSetterRule(predicate)); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/PluginFamily.cs =================================================================== --- trunk/Source/StructureMap/Graph/PluginFamily.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Graph/PluginFamily.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -371,6 +371,8 @@ set { _defaultKey = value ?? string.Empty; } } + public Instance MissingInstance { get; set; } + #endregion } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs =================================================================== --- trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Graph/SetterPropertyCollection.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -125,5 +125,10 @@ return null; } + + public void UseSetterRule(Predicate<PropertyInfo> rule) + { + _properties.FindAll(setter => rule(setter.Property)).ForEach(setter => setter.IsMandatory = true); + } } } \ No newline at end of file Modified: trunk/Source/StructureMap/IContainer.cs =================================================================== --- trunk/Source/StructureMap/IContainer.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/IContainer.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -57,7 +57,6 @@ /// <summary> /// Creates a new instance of the requested type T using the supplied Instance. Mostly used internally /// </summary> - /// <param name="pluginType"></param> /// <param name="instance"></param> /// <returns></returns> T GetInstance<T>(Instance instance); @@ -81,7 +80,6 @@ /// </summary> /// <param name="pluginType"></param> /// <param name="instanceKey"></param> - /// <param name="instance"></param> /// <returns></returns> object TryGetInstance(Type pluginType, string instanceKey); @@ -89,7 +87,6 @@ /// Creates or finds the default instance of the pluginType. Returns null if the pluginType is not known to the container. /// </summary> /// <param name="pluginType"></param> - /// <param name="instance"></param> /// <returns></returns> object TryGetInstance(Type pluginType); @@ -97,7 +94,6 @@ /// Creates or finds the default instance of type T. Returns the default value of T if it is not known to the container. /// </summary> /// <typeparam name="T"></typeparam> - /// <param name="instance"></param> /// <returns></returns> T TryGetInstance<T>(); @@ -105,7 +101,6 @@ /// 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. /// </summary> /// <typeparam name="T"></typeparam> - /// <param name="instance"></param> /// <returns></returns> T TryGetInstance<T>(string instanceKey); @@ -183,11 +178,9 @@ /// <summary> /// Gets the default instance of type T using the explicitly configured arguments from the "args" /// </summary> - /// <typeparam name="T"></typeparam> + /// <param name="type"></param> /// <param name="args"></param> /// <returns></returns> - - IList GetAllInstances(Type type, ExplicitArguments args); T GetInstance<T>(ExplicitArguments args); @@ -222,5 +215,15 @@ /// </summary> /// <typeparam name="T"></typeparam> void EjectAllInstancesOf<T>(); + + /// <summary> + /// The "BuildUp" method takes in an already constructed object + /// and uses Setter Injection to push in configured dependencies + /// of that object + /// </summary> + /// <param name="target"></param> + void BuildUp(object target); + + void SetDefault(Type pluginType, Instance instance); } } \ No newline at end of file Modified: trunk/Source/StructureMap/IInstanceFactory.cs =================================================================== --- trunk/Source/StructureMap/IInstanceFactory.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/IInstanceFactory.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -14,6 +14,7 @@ Type PluginType { get; } IEnumerable<IInstance> Instances { get; } IBuildPolicy Policy { get; } + Instance MissingInstance { get; set; } void AddInstance(Instance instance); Instance AddType<T>(); Modified: trunk/Source/StructureMap/InitializationExpression.cs =================================================================== --- trunk/Source/StructureMap/InitializationExpression.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/InitializationExpression.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -166,6 +166,14 @@ /// <typeparam name="PLUGINTYPE"></typeparam> /// <returns></returns> CreatePluginFamilyExpression<PLUGINTYPE> FillAllPropertiesOfType<PLUGINTYPE>(); + + /// <summary> + /// Creates automatic "policies" for which public setters are considered mandatory + /// properties by StructureMap that will be "setter injected" as part of the + /// construction process. + /// </summary> + /// <param name="action"></param> + void SetAllProperties(Action<SetterConvention> action); } public class InitializationExpression : ConfigurationExpression, IInitializationExpression @@ -178,7 +186,14 @@ public bool UseDefaultStructureMapConfigFile { - set { _parserBuilder.UseAndEnforceExistenceOfDefaultFile = value; } + set + { + _parserBuilder.UseAndEnforceExistenceOfDefaultFile = value; + if (!value) + { + _parserBuilder.IgnoreDefaultFile = true; + } + } } public bool IgnoreStructureMapConfig Modified: trunk/Source/StructureMap/InstanceBuilder.cs =================================================================== --- trunk/Source/StructureMap/InstanceBuilder.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/InstanceBuilder.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -11,10 +11,13 @@ { private Container _manager; + // DO NOT ELIMINATE THIS METHOD public InstanceBuilder(){} public abstract Type PluggedType { get; } public abstract object BuildInstance(IConfiguredInstance instance, BuildSession session); + + public virtual void BuildUp(IConfiguredInstance instance, BuildSession session, object target) { } } } \ No newline at end of file Modified: trunk/Source/StructureMap/InstanceFactory.cs =================================================================== --- trunk/Source/StructureMap/InstanceFactory.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/InstanceFactory.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -17,6 +17,7 @@ private readonly Type _pluginType; private IBuildPolicy _policy = new BuildPolicy(); + #region constructor functions @@ -40,8 +41,8 @@ _policy = family.Policy; _pluginType = family.PluginType; + MissingInstance = family.MissingInstance; - family.EachInstance(AddInstance); } catch (StructureMapException) @@ -74,6 +75,8 @@ #region IInstanceFactory Members + public Instance MissingInstance { get; set; } + public Type PluginType { get { return _pluginType; } @@ -132,7 +135,7 @@ public Instance FindInstance(string name) { - return _instances[name]; + return _instances[name] ?? MissingInstance; } public void ImportFrom(PluginFamily family) Modified: trunk/Source/StructureMap/ObjectFactory.cs =================================================================== --- trunk/Source/StructureMap/ObjectFactory.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/ObjectFactory.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -417,5 +417,16 @@ return container.TryGetInstance<T>(instanceKey); } + /// <summary> + /// The "BuildUp" method takes in an already constructed object + /// and uses Setter Injection to push in configured dependencies + /// of that object + /// </summary> + /// <param name="target"></param> + public static void BuildUp(object target) + { + container.BuildUp(target); + } + } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/BuildFrame.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/BuildFrame.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/Pipeline/BuildFrame.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -2,12 +2,31 @@ namespace StructureMap.Pipeline { + public interface IBuildFrame + { + /// <summary> + /// The requested PluginType of the Instance being create + /// </summary> + Type RequestedType { get; } + + /// <summary> + /// The Name of the Instance being created + /// </summary> + string Name { get; } + + /// <summary> + /// The actual ConcreteType being created. This will not always + /// be available + /// </summary> + Type ConcreteType { get; } + } + /// <summary> /// 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 /// </summary> - public class BuildFrame + public class BuildFrame : IBuildFrame { private readonly Type _concreteType; private readonly string _name; Added: trunk/Source/StructureMap/Pipeline/ConditionalInstance.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/ConditionalInstance.cs (rev 0) +++ trunk/Source/StructureMap/Pipeline/ConditionalInstance.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using StructureMap.Configuration.DSL.Expressions; + +namespace StructureMap.Pipeline +{ + public class ConditionalInstance<T> : ExpressedInstance<ConditionalInstance<T>> + { + // Conditional Instance keeps track of zero or more internal Instance + // objects against a Predicate<IContext> condition + private readonly List<InstanceCase> _cases = new List<InstanceCase>(); + + // The "default" Instance to use if none of the conditional predicates + // are met. If this is not explicitly defined, the ConditionalInstance + // will simply look for the default Instance of the desired + // PluginType + public Instance _default = new DefaultInstance(); + + + public ConditionalInstance(Action<ConditionalInstanceExpression<T>> action) + { + action(new ConditionalInstanceExpression<T>(this)); + } + + protected override string getDescription() + { + return "Conditional Instance of " + typeof (T).FullName; + } + + protected override object build(Type pluginType, BuildSession session) + { + // Find the first InstanceCase that matches the BuildSession/IContext + var instanceCase = _cases.Find(c => c.Predicate(session)); + + // Use the Instance from the InstanceCase if it exists, + // otherwise, use the "default" + var instance = instanceCase == null ? _default : instanceCase.Instance; + + // delegate to the chosen Instance + return instance.Build(pluginType, session); + } + + public class ConditionalInstanceExpression<T> + { + private readonly ConditionalInstance<T> _parent; + + public ConditionalInstanceExpression(ConditionalInstance<T> parent) + { + _parent = parent; + } + + public ThenItExpression<T> If(Predicate<IContext> predicate) + { + return new InstanceExpression<T>(i => + { + var theCase = new InstanceCase() {Instance = i, Predicate = predicate}; + _parent._cases.Add(theCase); + }); + } + + public IsExpression<T> TheDefault + { + get + { + return new InstanceExpression<T>(i => _parent._default = i); + } + } + + + } + + protected override ConditionalInstance<T> thisInstance + { + get { return this; } + } + } + + public class InstanceCase + { + public Predicate<IContext> Predicate { get; set; } + public Instance Instance { get; set; } + } +} \ No newline at end of file Modified: trunk/Source/StructureMap/ReflectionHelper.cs =================================================================== --- trunk/Source/StructureMap/ReflectionHelper.cs 2009-01-02 23:58:17 UTC (rev 213) +++ trunk/Source/StructureMap/ReflectionHelper.cs 2009-01-03 00:07:32 UTC (rev 214) @@ -1,4 +1,7 @@ using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; using System.Linq.Expressions; using System.Reflection; @@ -58,4 +61,407 @@ return methodCall.Method; } } + + /// <summary> + /// Provides virtual methods that can be used by subclasses to parse an expression tree. + /// </summary> + /// <remarks> + /// 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... + /// </remarks> + [DebuggerStepThrough, DebuggerNonUserCode] + public abstract class ExpressionVisitorBase + { + public virtual Expression Visit(Expression exp) + { + if (exp == null) return exp; + + switch (exp.NodeType) + { + case ExpressionType.Negate: + case ExpressionType.NegateChecked: + case ExpressionType.Not: + case ExpressionType.Convert: + case ExpressionType.ConvertChecked: + case ExpressionType.ArrayLength: + case ExpressionType.Quote: + case ExpressionType.TypeAs: + return VisitUnary((UnaryExpression)exp); + case ExpressionType.Add: + case ExpressionType.AddChecked: + case ExpressionType.Subtract: + case ExpressionType.SubtractChecked: + case ExpressionType.Multiply: + case ExpressionType.MultiplyChecked: + case ExpressionType.Divide: + case ExpressionType.Modulo: + case ExpressionType.And: + case ExpressionType.AndAlso: + case ExpressionType.Or: + case ExpressionType.OrElse: + case ExpressionType.LessThan: + case ExpressionType.LessThanOrEqual: + case ExpressionType.GreaterThan: + case ExpressionType.GreaterThanOrEqual: + case ExpressionType.Equal: + case ExpressionType.NotEqual: + case ExpressionType.Coalesce: + case ExpressionType.ArrayIndex: + case ExpressionType.RightShift: + case ExpressionType.LeftShift: + case ExpressionType.ExclusiveOr: + return VisitBinary((BinaryExpression)exp); + case ExpressionType.TypeIs: + return VisitTypeIs((TypeBinaryExpression)exp); + case ExpressionType.Conditional: + return VisitConditional((ConditionalExpression)exp); + case ExpressionType.Constant: + return VisitConstant((ConstantExpression)exp); + case ExpressionType.Parameter: + return VisitParameter((ParameterExpression)exp); + case ExpressionType.MemberAccess: + return VisitMemberAccess((MemberExpression)exp); + case ExpressionType.Call: + return VisitMethodCall((MethodCallExpression)exp); + case ExpressionType.Lambda: + return VisitLambda((LambdaExpression)exp); + case ExpressionType.New: + return VisitNew((NewExpression)exp); + case ExpressionType.NewArrayInit: + case ExpressionType.NewArrayBounds: + return VisitNewArray((NewArrayExpression)exp); + case ExpressionType.Invoke: + return VisitInvocation((InvocationExpression)exp); + case ExpressionType.MemberInit: + return VisitMemberInit((MemberInitExpression)exp); + case ExpressionType.ListInit: + return VisitListInit((ListInitExpression)exp); + default: + throw new NotSupportedException(String.Format("Unhandled expression type: '{0}'", exp.NodeType)); + } + } + + protected virtual MemberBinding VisitBinding(MemberBinding binding) + { + switch (binding.BindingType) + { + case MemberBindingType.Assignment: + return VisitMemberAssignment((MemberAssignment)binding); + case MemberBindingType.MemberBinding: + return VisitMemberMemberBinding((MemberMemberBinding)binding); + case MemberBindingType.ListBinding: + return VisitMemberListBinding((MemberListBinding)binding); + default: + throw new NotSupportedException(string.Format("Unhandled binding type '{0}'", binding.BindingType)); + } + } + + protected virtual ElementInit VisitElementInitializer(ElementInit initializer) + { + ReadOnlyCollection<Expression> arguments = VisitList(initializer.Arguments); + if (arguments != initializer.Arguments) + { + return Expression.ElementInit(initializer.AddMethod, arguments); + } + return initializer; + } + + protected virtual Expression VisitUnary(UnaryExpression u) + { + Expression operand = Visit(u.Operand); + if (operand != u.Operand) + { + return Expression.MakeUnary(u.NodeType, operand, u.Type, u.Method); + } + return u; + } + + protected virtual Expression VisitBinary(BinaryExpression b) + { + Expression left = Visit(b.Left); + Expression right = Visit(b.Right); + Expression conversion = Visit(b.Conversion); + + if (left != b.Left || right != b.Right || conversion != b.Conversion) + { + if (b.NodeType == ExpressionType.Coalesce && b.Conversion != null) + return Expression.Coalesce(left, right, conversion as LambdaExpression); + else + return Expression.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method); + } + return b; + } + + protected virtual Expression VisitTypeIs(TypeBinaryExpression b) + { + Expression expr = Visit(b.Expression); + if (expr != b.Expression) + { + return Expression.TypeIs(expr, b.TypeOperand); + } + return b; + } + + protected virtual Expression VisitConstant(ConstantExpression c) + { + return c; + } + + protected virtual Expression VisitConditional(ConditionalExpression c) + { + Expression test = Visit(c.Test); + Expression ifTrue = Visit(c.IfTrue); + Expression ifFalse = Visit(c.IfFalse); + + if (test != c.Test || ifTrue != c.IfTrue || ifFalse != c.IfFalse) + { + return Expression.Condition(test, ifTrue, ifFalse); + } + + return c; + } + + protected virtual Expression VisitParameter(ParameterExpression p) + { + return p; + } + + protected virtual Expression VisitMemberAccess(MemberExpression m) + { + Expression exp = Visit(m.Expression); + if (exp != m.Expression) + { + return Expression.MakeMemberAccess(exp, m.Member); + } + return m; + } + + protected virtual Expression VisitMethodCall(MethodCallExpression m) + { + Expression obj = Visit(m.Object); + IEnumerable<Expression> args = VisitList(m.Arguments); + + if (obj != m.Object || args != m.Arguments) + { + return Expression.Call(obj, m.Method, args); + } + + return m; + } + + protected virtual ReadOnlyCollection<Expression> VisitList(ReadOnlyCollection<Expression> original) + { + List<Expression> list = null; + for (int i = 0, n = original.Count; i < n; i++) + { + Expression p = Visit(original[i]); + if (list != null) + { + list.Add(p); + } + else if (p != original[i]) + { + list = new List<Expression>(n); + for (int j = 0; j < i; j++) + { + list.Add(original[j]); + } + list.Add(p); + } + } + + if (list != null) + return list.AsReadOnly(); + + return original; + } + + protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignment) + { + Expression e = Visit(assignment.Expression); + + if (e != assignment.Expression) + { + return Expression.Bind(assignment.Member, e); + } + + return assignment; + } + + protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding) + { + IEnumerable<MemberBinding> bindings = VisitBindingList(binding.Bindings); + + if (bindings != binding.Bindings) + { + return Expression.MemberBind(binding.Member, bindings); + } + + return binding; + } + + protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding) + { + IEnumerable<ElementInit> initializers = VisitElementInitializerList(binding.Initializers); + + if (initializers != binding.Initializers) + { + return Expression.ListBind(binding.Member, initializers); + } + return binding; + } + + protected virtual IEnumerable<MemberBinding> VisitBindingList(ReadOnlyCollection<MemberBinding> original) + { + List<MemberBinding> list = null; + for (int i = 0, n = original.Count; i < n; i++) + { + MemberBinding b = VisitBinding(original[i]); + if (list != null) + { + list.Add(b); + } + else if (b != original[i]) + { + list = new List<MemberBinding>(n); + for (int j = 0; j < i; j++) + { + list.Add(original[j]); + } + list.Add(b); + } + } + + if (list != null) + return list; + + return original; + } + + protected virtual IEnumerable<ElementInit> VisitElementInitializerList(ReadOnlyCollection<ElementInit> original) + { + List<ElementInit> list = null; + for (int i = 0, n = original.Count; i < n; i++) + { + ElementInit init = VisitElementInitializer(original[i]); + if (list != null) + { + list.Add(init); + } + else if (init != original[i]) + { + list = new List<ElementInit>(n); + for (int j = 0; j < i; j++) + { + list.Add(original[j]); + } + list.Add(init); + } + } + + if (list != null) + return list; + + return original; + } + + protected virtual Expression VisitLambda(LambdaExpression lambda) + { + Expression body = Visit(lambda.Body); + if (body != lambda.Body) + { + return Expression.Lambda(lambda.Type, body, lambda.Parameters); + } + return lambda; + } + + protected virtual N... [truncated message content] |
From: <jer...@us...> - 2009-01-12 03:29:39
|
Revision: 220 http://structuremap.svn.sourceforge.net/structuremap/?rev=220&view=rev Author: jeremydmiller Date: 2009-01-12 03:29:13 +0000 (Mon, 12 Jan 2009) Log Message: ----------- The final check in for 2.5.2 Modified Paths: -------------- trunk/Source/HTML/AutoMocker.htm trunk/Source/HTML/DependencyInjection.htm trunk/Source/HTML/HTML.csproj trunk/Source/HTML/InversionOfControl.htm trunk/Source/HTML/Menu.htm trunk/Source/StructureMap/StructureMap.csproj trunk/Source/StructureMap.AutoMocking/AutoMocker.cs trunk/Source/StructureMap.Testing/AutoMocking/RhinoAutoMockerTester.cs trunk/Source/StructureMap.sln Added Paths: ----------- trunk/Source/HTML/StructureMap.chm trunk/Source/HTML/TableOfContents.htm trunk/Source/HTML/ToC-Bullet-List.xml trunk/Source/TableOfContentsBuilder/ trunk/Source/TableOfContentsBuilder/Program.cs trunk/Source/TableOfContentsBuilder/Properties/ trunk/Source/TableOfContentsBuilder/Properties/AssemblyInfo.cs trunk/Source/TableOfContentsBuilder/TableOfContentsBuilder.csproj trunk/Source/TableOfContentsBuilder/XmlExtensions.cs trunk/bin/Watin/ trunk/bin/Watin/Interop.SHDocVw.dll trunk/bin/Watin/WatiN.Core.dll Modified: trunk/Source/HTML/AutoMocker.htm =================================================================== --- trunk/Source/HTML/AutoMocker.htm 2009-01-11 22:43:11 UTC (rev 219) +++ trunk/Source/HTML/AutoMocker.htm 2009-01-12 03:29:13 UTC (rev 220) @@ -7,6 +7,385 @@ <script type="text/javascript" src="structuremap.js"></script> </head> <body> - Forthcoming... ETA: 1st Qtr 2009 + <p>StructureMap includes an + <a href="http://blog.eleutian.com/CommentView,guid,762249da-e25a-4503-8f20-c6d59b1a69bc.aspx"> + Auto Mocking Container</a> (a couple actually). If you're not familiar + with the concept, an Auto Mocking Container repurposes an IoC container to + automate the creation and attachment of mock objects to a concrete class within + unit tests. The key fact about any auto mocking container is that it + reduces the mechanical cost of creating + <a href="http://codebetter.com/blogs/jeremy.miller/pages/129544.aspx"> + interaction tests</a> by obviating the need to create mock objects by hand, + track those mock objects in the test, and apply the mocks to a concrete class. + Out of the box, StructureMap includes the RhinoAutoMocker for + <a href="http://ayende.com/projects/rhino-mocks.aspx">RhinoMocks</a> and + MoqAutoMocker for <a href="http://code.google.com/p/moq/">Moq</a>. The + Auto Mocking support is in the StructureMap.AutoMocking.dll.</p> + <p> </p> + + <h2>How it Works</h2> + <p>Let's start with an example from the unit tests. Let's say that you have a + class named "ConcreteClass" that uses three other types of services to perform + its responsibilities.</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 public\cf0 ConcreteClass(\cf4 IMockedService\cf0 service, \cf4 IMockedService2\cf0 service2, \cf4 IMockedService3\cf0 service3)\par ?? \{\par ?? _service = service;\par ?? _service2 = service2;\par ?? _service3 = service3;\par ?? \}} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: blue;"> + public</span> ConcreteClass(<span style="color: #2b91af;">IMockedService</span> + service, <span style="color: #2b91af;">IMockedService2</span> service2, + <span style="color: #2b91af;">IMockedService3</span> service3)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + + _service = service;</p> + <p style="margin: 0px;"> + + _service2 = service2;</p> + <p style="margin: 0px;"> + + _service3 = service3;</p> + <p style="margin: 0px;"> + }</p> + </div> +<!--EndFragment--> +<p>Traditionally, I might write integration tests against ConcreteClass by creating + a different mock object for each service dependency, attach each in the + constructor function of ConcreteClass, and probably track each mock object in a + field of the unit test fixture. With the auto mocking container, it's + simpler:</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;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 // This sets up a Rhino Auto Mocker in the Arrange, Act, Assert mode\par ??\cf0 \cf4 var\cf0 autoMocker = \cf4 new\cf0 \cf5 RhinoAutoMocker\cf0 <\cf5 ConcreteClass\cf0 >(\cf5 MockMode\cf0 .AAA);} +--> + <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;"> + // This sets up a Rhino Auto Mocker in the Arrange, Act, Assert mode</span></p> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> autoMocker = <span style="color: blue;">new</span> + <span style="color: #2b91af;">RhinoAutoMocker</span><<span + style="color: #2b91af;">ConcreteClass</span>>(<span style="color: #2b91af;">MockMode</span>.AAA);</p> + </div> +<!--EndFragment--> +<p>That's the entire mock object setup. To get an instance of the + ConcreteClass inside the unit test you access the ClassUnderTest property of the + auto mocker:</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;}??\fs20 \cf3 // Act in the test\par ??\cf0 \cf4 ConcreteClass\cf0 @class = autoMocker.ClassUnderTest;\par ?? @class.CallService();} +--> + <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;"> + // Act in the test</span></p> + <p style="margin: 0px;"> + <span style="color: #2b91af;"> + ConcreteClass</span> @class = autoMocker.ClassUnderTest;</p> + <p style="margin: 0px;"> + @class.CallService();</p> + </div> +<!--EndFragment--> +<p>At the first call to the RhinoAutoMocker.ClassUnderTest, the RhinoAutoMocker:</p> + <ol> + <li> Looked at ConcreteClass</li> + <li>Saw that the greediest constructor required instances of three different + dependencies</li> + <li>Created mock objects using the RhinoMocks MockRepository.CreateMock<T>() method + for each type of dependency</li> + <li>Then called the constructor function of ConcreteClass to build a new instance</li> + </ol> + <p> + ClassUnderTest is created upon demand. Likewise, you can access the actual + mock objects either to set expectations before ClassUnderTest is created, or to + assert method calls after the action. Use the Get<T>() method to access + the mock objects per type that will be used in the test:</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;}??\fs20 \cf3 // This retrieves the mock object for IMockedService\par ??\cf0 autoMocker.Get<\cf4 IMockedService\cf0 >().AssertWasCalled(s => s.Go());} +--> + <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;"> + // This retrieves the mock object for IMockedService</span></p> + <p style="margin: 0px;"> + autoMocker.Get<<span + style="color: #2b91af;">IMockedService</span>>().AssertWasCalled(s => + s.Go());</p> + </div> +<!--EndFragment--> +<hr /> + + <h2>How it uses Mock Engines</h2> + <p>If you wanted to use the AutoMocker with another type of Mock Object Library, you + can simply use the AutoMocker<CLASSUNDERTEST> class, but feed it an + implementation of this interface that works with the mock object library of your + choice:</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 public\cf0 \cf3 interface\cf0 \cf4 ServiceLocator\par ??\cf0 \{\par ?? T Service<T>() \cf3 where\cf0 T : \cf3 class\cf0 ;\par ?? \cf3 object\cf0 Service(\cf4 Type\cf0 serviceType);\par ?? T PartialMock<T>(\cf3 params\cf0 \cf3 object\cf0 [] args) \cf3 where\cf0 T : \cf3 class\cf0 ;\par ?? \}} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> <span style="color: blue;">interface</span> + <span style="color: #2b91af;">ServiceLocator</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + T Service<T>() <span style="color: blue;">where</span> + T : <span style="color: blue;">class</span>;</p> + <p style="margin: 0px;"> + <span style="color: blue;">object</span> Service(<span + style="color: #2b91af;">Type</span> serviceType);</p> + <p style="margin: 0px;"> + T PartialMock<T>(<span style="color: blue;">params</span> + <span style="color: blue;">object</span>[] args) <span style="color: blue;"> + where</span> T : <span style="color: blue;">class</span>;</p> + <p style="margin: 0px;"> + }</p> + </div> +<!--EndFragment--> +<p>The RhinoMocks "AAA" mode is 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;}??\fs20 \cf3 public\cf0 \cf3 class\cf0 \cf4 RhinoMocksAAAServiceLocator\cf0 : \cf4 ServiceLocator\par ??\cf0 \{\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 RhinoMockRepositoryProxy\cf0 _mocks = \cf3 new\cf0 \cf4 RhinoMockRepositoryProxy\cf0 ();\par ??\par ?? \cf3 public\cf0 T Service<T>() \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 var\cf0 instance = (T)_mocks.DynamicMock(\cf3 typeof\cf0 (T));\par ?? _mocks.Replay(instance);\par ?? \cf3 return\cf0 instance;\par ?? \}\par ??\par ?? \cf3 public\cf0 \cf3 object\cf0 Service(\cf4 Type\cf0 serviceType)\par ?? \{\par ?? \cf3 var\cf0 instance = _mocks.DynamicMock(serviceType);\par ?? _mocks.Replay(instance);\par ?? \cf3 return\cf0 instance;\par ?? \}\par ??\par ?? \cf3 public\cf0 T PartialMock<T>(\cf3 params\cf0 \cf3 object\cf0 [] args) \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 var\cf0 instance = (T)_mocks.PartialMock(\cf3 typeof\cf0 (T), args);\par ?? _mocks.Replay(instance);\par ?? \cf3 return\cf0 instance;\par ?? \}\par ?? \}} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> <span style="color: blue;">class</span> + <span style="color: #2b91af;">RhinoMocksAAAServiceLocator</span> : + <span style="color: #2b91af;">ServiceLocator</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;">private</span> + <span style="color: blue;">readonly</span> <span style="color: #2b91af;"> + RhinoMockRepositoryProxy</span> _mocks = <span style="color: blue;">new</span> + <span style="color: #2b91af;">RhinoMockRepositoryProxy</span>();</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> T + Service<T>() <span style="color: blue;">where</span> T : + <span style="color: blue;">class</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> instance = (T)_mocks.DynamicMock(<span style="color: blue;">typeof</span> + (T));</p> + <p style="margin: 0px;"> + _mocks.Replay(instance);</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + return</span> instance;</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> + <span style="color: blue;">object</span> Service(<span style="color: #2b91af;">Type</span> + serviceType)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> instance = _mocks.DynamicMock(serviceType);</p> + <p style="margin: 0px;"> + _mocks.Replay(instance);</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + return</span> instance;</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> T + PartialMock<T>(<span style="color: blue;">params</span> + <span style="color: blue;">object</span>[] args) <span style="color: blue;"> + where</span> T : <span style="color: blue;">class</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> instance = (T)_mocks.PartialMock(<span style="color: blue;">typeof</span>(T), + args);</p> + <p style="margin: 0px;"> + _mocks.Replay(instance);</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + return</span> instance;</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + }</p> + </div> +<!--EndFragment--> +<p>And this is the Moq version:</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 public\cf0 \cf3 class\cf0 \cf4 MoqServiceLocator\cf0 : \cf4 ServiceLocator\par ??\cf0 \{\par ?? \cf3 private\cf0 \cf3 readonly\cf0 \cf4 MoqFactory\cf0 _moqs = \cf3 new\cf0 \cf4 MoqFactory\cf0 ();\par ?? \par ?? \cf3 public\cf0 T Service<T>() \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 return\cf0 (T)_moqs.CreateMock(\cf3 typeof\cf0 (T));\par ?? \}\par ??\par ?? \cf3 public\cf0 \cf3 object\cf0 Service(\cf4 Type\cf0 serviceType)\par ?? \{\par ?? \cf3 return\cf0 _moqs.CreateMock(serviceType);\par ?? \}\par ??\par ?? \cf3 public\cf0 T PartialMock<T>(\cf3 params\cf0 \cf3 object\cf0 [] args) \cf3 where\cf0 T : \cf3 class\par ??\cf0 \{\par ?? \cf3 return\cf0 (T)_moqs.CreateMockThatCallsBase(\cf3 typeof\cf0 (T), args);\par ?? \}\par ?? \}} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> <span style="color: blue;">class</span> + <span style="color: #2b91af;">MoqServiceLocator</span> : + <span style="color: #2b91af;">ServiceLocator</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;">private</span> + <span style="color: blue;">readonly</span> <span style="color: #2b91af;"> + MoqFactory</span> _moqs = <span style="color: blue;">new</span> + <span style="color: #2b91af;">MoqFactory</span>();</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> T + Service<T>() <span style="color: blue;">where</span> T : + <span style="color: blue;">class</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + return</span> (T)_moqs.CreateMock(<span style="color: blue;">typeof</span>(T));</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> + <span style="color: blue;">object</span> Service(<span style="color: #2b91af;">Type</span> + serviceType)</p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + return</span> _moqs.CreateMock(serviceType);</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;">public</span> T + PartialMock<T>(<span style="color: blue;">params</span> + <span style="color: blue;">object</span>[] args) <span style="color: blue;"> + where</span> T : <span style="color: blue;">class</span></p> + <p style="margin: 0px;"> + {</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + return</span> (T)_moqs.CreateMockThatCallsBase(<span style="color: blue;">typeof</span> + (T), args);</p> + <p style="margin: 0px;"> + }</p> + <p style="margin: 0px;"> + }</p> + </div> +<!--EndFragment--> +<hr /> + + <h2>Supplying Mocks or Stubs to the AutoMocker</h2> + <p>Frequently you may want to use the AutoMocker, but override the normal mock + object creation with your own stub or hand rolled mock objects. That's + easy enough with the Inject() methods:</p> +<!-- +{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red128\green128\blue128;\red0\green128\blue0;\red0\green0\blue255;\red43\green145\blue175;}??\fs20 \cf3 ///\cf4 \cf3 <summary>\par ??\cf0 \cf3 ///\cf4 Method to specify the exact object that will be used for \par ??\cf0 \cf3 ///\cf4 "pluginType." Useful for stub objects and/or static mocks\par ??\cf0 \cf3 ///\cf4 \cf3 </summary>\par ??\cf0 \cf3 ///\cf4 \cf3 <param name="pluginType"></param>\par ??\cf0 \cf3 ///\cf4 \cf3 <param name="stub"></param>\par ??\cf0 \cf5 void\cf0 Inject(\cf6 Type\cf0 pluginType, \cf5 object\cf0 stub);\par ??\par ?? \cf3 ///\cf4 \cf3 <summary>\par ??\cf0 \cf3 ///\cf4 Method to specify the exact object that will be used for \par ??\cf0 \cf3 ///\cf4 "pluginType." Useful for stub objects and/or static mocks\par ??\cf0 \cf3 ///\cf4 \cf3 </summary>\par ??\cf0 \cf3 ///\cf4 \cf3 <typeparam name="T"></typeparam>\par ??\cf0 \cf3 ///\cf4 \cf3 <param name="target"></param>\par ??\cf0 \cf5 void\cf0 Inject<T>(T target);} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"><summary></span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> Method to specify the exact object that will be used + for </span> + </p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> "pluginType." Useful for stub objects and/or + static mocks</span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"></summary></span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"><param + name="pluginType"></param></span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"><param + name="stub"></param></span></p> + <p style="margin: 0px;"> + <span style="color: blue;">void</span> Inject(<span + style="color: #2b91af;">Type</span> pluginType, <span style="color: blue;"> + object</span> stub);</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"><summary></span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> Method to specify the exact object that will be used + for </span> + </p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> "pluginType." Useful for stub objects and/or + static mocks</span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"></summary></span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"><typeparam + name="T"></typeparam></span></p> + <p style="margin: 0px;"> + <span style="color: gray;">///</span><span + style="color: green;"> </span><span style="color: gray;"><param + name="target"></param></span></p> + <p style="margin: 0px;"> + <span style="color: blue;">void</span> Inject<T>(T + target);</p> + </div> +<!--EndFragment--> +<hr /> + + <h2>Partial Mock the ClassUnderTest</h2> + <p>Every so often, I find it useful to create a "<a + href="http://ayende.com/wiki/Rhino+Mocks+Partial+Mocks.ashx">partial mock</a>" + for the ClassUnderTest. That can be done with the AutoMocker by calling + the PartialMockTheClassUnderTest() method:</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 autoMocker = createAutoMocker<\cf4 ConcreteClass\cf0 >();\par ??\par ?? \cf3 var\cf0 service = autoMocker.Get<\cf4 IMockedService\cf0 >();\par ?? \cf3 var\cf0 service2 = autoMocker.Get<\cf4 IMockedService2\cf0 >();\par ?? \cf3 var\cf0 service3 = autoMocker.Get<\cf4 IMockedService3\cf0 >();\par ??\par ?? autoMocker.PartialMockTheClassUnderTest();} +--> + <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border: black thin solid;"> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> autoMocker = createAutoMocker<<span style="color: #2b91af;">ConcreteClass</span>>();</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> service = autoMocker.Get<<span style="color: #2b91af;">IMockedService</span>>();</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> service2 = autoMocker.Get<<span style="color: #2b91af;">IMockedService2</span>>();</p> + <p style="margin: 0px;"> + <span style="color: blue;"> + var</span> service3 = autoMocker.Get<<span style="color: #2b91af;">IMockedService3</span>>();</p> + <p style="margin: 0px;"> + </p> + <p style="margin: 0px;"> + + autoMocker.PartialMockTheClassUnderTest();</p> + </div> +<!--EndFragment--> +<p>Expectations and assertions can be made directly on the AutoMocker.ClassUnderTest + property. When the PartialMockTheClassUnderTest() method is called, the + underlying value behind ClassUnderTest will be a partial mock, but the + AutoMocker will still use mock objects for the dependencies of the class under + test.</p> + <hr /> </body> </html> \ No newline at end of file Modified: trunk/Source/HTML/DependencyInjection.htm =================================================================== --- trunk/Source/HTML/DependencyInjection.htm 2009-01-11 22:43:11 UTC (rev 219) +++ trunk/Source/HTML/DependencyInjection.htm 2009-01-12 03:29:13 UTC (rev 220) @@ -22,8 +22,7 @@ still thinks it's much cleaner to use DI ;-)</p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> </p> - <h2 style="margin: 0in 0in 0pt;"> - Dependency Injection</h2> + <h2>Dependency Injection</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> </p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -76,8 +75,7 @@ <hr /> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> - <h2 style="margin: 0in 0in 0pt;"> - <b style="">Example Problem<o:p></o:p></b></h2> + <h2>Example Problem</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <b style=""><o:p> </o:p></b></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -277,8 +275,7 @@ <hr /> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> - <h2 style="margin: 0in 0in 0pt;"> - <b style=""><span class="style1">Constructor Injection</span><o:p></o:p></b></h2> + <h2>Constructor Injection</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <b style=""><o:p> </o:p></b></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -475,8 +472,7 @@ <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <b style=""><o:p> </o:p></b></p> <hr /> - <h2 style="margin: 0in 0in 0pt;"> - <b style=""><span class="style1">Setter Injection</span><o:p></o:p></b></h2> + <h2>Setter Injection</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -719,8 +715,7 @@ <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> <hr /> - <h2 style="margin: 0in 0in 0pt;"> - <b style=""><span class="style1">Service Locator</span><o:p></o:p></b></h2> + <h2>Service Locator</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <b style=""><o:p> </o:p></b></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -875,8 +870,7 @@ <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> <hr /> - <h2 style="margin: 0in 0in 0pt;"> - <span style="">Good for More than Unit Testing<o:p></o:p></span></h2> + <h2>Good for More than Unit Testing</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <b style=""><o:p> </o:p></b></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -1034,8 +1028,7 @@ <p class="MsoNormal" style="margin: 0in 0in 0pt;"> </p> <hr /> - <h2 style="margin: 0in 0in 0pt;"> - <span style="">Using a Dependency Injection Tool<o:p></o:p></span></h2> + <h2>Using a Dependency Injection Tool</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> </p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> Modified: trunk/Source/HTML/HTML.csproj =================================================================== --- trunk/Source/HTML/HTML.csproj 2009-01-11 22:43:11 UTC (rev 219) +++ trunk/Source/HTML/HTML.csproj 2009-01-12 03:29:13 UTC (rev 220) @@ -66,6 +66,8 @@ <Content Include="InversionOfControl.htm" /> <Content Include="Profiles.htm" /> <Content Include="Scoping.htm" /> + <Content Include="TableOfContents.htm" /> + <Content Include="ToC-Bullet-List.xml" /> <Content Include="UsingAttributes.htm" /> <Content Include="AutoWiring.htm" /> <Content Include="ConfiguringStructureMap.htm" /> @@ -113,4 +115,7 @@ <Install>false</Install> </BootstrapperPackage> </ItemGroup> + <ItemGroup> + <None Include="StructureMap.chm" /> + </ItemGroup> </Project> \ No newline at end of file Modified: trunk/Source/HTML/InversionOfControl.htm =================================================================== --- trunk/Source/HTML/InversionOfControl.htm 2009-01-11 22:43:11 UTC (rev 219) +++ trunk/Source/HTML/InversionOfControl.htm 2009-01-12 03:29:13 UTC (rev 220) @@ -28,8 +28,7 @@ <o:p> </o:p></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> - <h2 style="margin: 0in 0in 0pt;"> - <b style=""><span class="style1">Real Life Example</span><o:p></o:p></b></h2> + <h2>Real Life Example</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <b style=""><o:p> </o:p></b></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -352,8 +351,7 @@ </ul> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> - <h2 style="margin: 0in 0in 0pt;"> - <b style="">Refactoring to Inversion of Control<o:p></o:p></b></h2> + <h2>Refactoring to Inversion of Control</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> @@ -559,8 +557,7 @@ </p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <o:p> </o:p></p> - <h2 style="margin: 0in 0in 0pt;"> - <b style="">Other Examples<o:p></o:p></b></h2> + <h2>Other Examples</h2> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> <b style=""><o:p> </o:p></b></p> <p class="MsoNormal" style="margin: 0in 0in 0pt;"> Modified: trunk/Source/HTML/Menu.htm =================================================================== --- trunk/Source/HTML/Menu.htm 2009-01-11 22:43:11 UTC (rev 219) +++ trunk/Source/HTML/Menu.htm 2009-01-12 03:29:13 UTC (rev 220) @@ -13,8 +13,9 @@ <li><a href="http://dimecasts.net/Casts/ByTag/StructureMap">StructureMap on DimeCasts</a></li> <li><a href="http://teamcity.codebetter.com/viewType.html?buildTypeId=bt5&tab=buildTypeStatusDiv"> StructureMap CI Server on TeamCity.Codebetter.com</a></li> - <li>Full Table of Contents</li> + <li><a href="TableOfContents.htm">Full Table of Contents</a></li> <li><a href="FeatureList.htm">Feature List</a></li> + <li><a href="StructureMap.chm">API Documentation</a></li> </ul> <br /> <ul> Added: trunk/Source/HTML/StructureMap.chm =================================================================== (Binary files differ) Property changes on: trunk/Source/HTML/StructureMap.chm ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Source/HTML/TableOfContents.htm =================================================================== --- trunk/Source/HTML/TableOfContents.htm (rev 0) +++ trunk/Source/HTML/TableOfContents.htm 2009-01-12 03:29:13 UTC (rev 220) @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> + <head> + <title>Table of Contents</title> + <link rel="stylesheet" type="text/css" href="style.css" /> + <script type="text/javascript" src="jquery-1.2.6.js"></script> + <script type="text/javascript" src="structuremap.js"></script> + </head> + <body> + <script language="javascript"> + $(document).ready(function() { + $.get('ToC-Bullet-List.xml', {}, writeTOC, 'HTML'); + }); + + function writeTOC(data) { + $('#main').html(data); + } + </script> + + <div id="main"> + + </div> + </body> +</html> \ No newline at end of file Added: trunk/Source/HTML/ToC-Bullet-List.xml =================================================================== --- trunk/Source/HTML/ToC-Bullet-List.xml (rev 0) +++ trunk/Source/HTML/ToC-Bullet-List.xml 2009-01-12 03:29:13 UTC (rev 220) @@ -0,0 +1,835 @@ +<div> + <ul> + <li> + <a href="default.htm">Home</a> + <ul> + <li> + <a href="default.htm#section0">Status</a> + <ul /> + </li> + <li> + <a href="default.htm#section1">Related Links:</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="FeatureList.htm">Feature List</a> + <ul /> + </li> + <li> + <a href="QuickStart.htm">A Gentle Quickstart</a> + <ul> + <li> + <a href="QuickStart.htm#section0">Salient Facts</a> + <ul /> + </li> + <li> + <a href="QuickStart.htm#section1">The Simplest Possible Usage of StructureMap</a> + <ul /> + </li> + <li> + <a href="QuickStart.htm#section2">Primitive Arguments</a> + <ul /> + </li> + <li> + <a href="QuickStart.htm#section3">Auto Wiring</a> + <ul /> + </li> + <li> + <a href="QuickStart.htm#section4">What to do when things go wrong?</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="Glossary.htm">Glossary</a> + <ul> + <li> + <a href="Glossary.htm#section0">Container</a> + <ul /> + </li> + <li> + <a href="Glossary.htm#section1">PluginType &amp; PluggedType</a> + <ul /> + </li> + <li> + <a href="Glossary.htm#section2">Instance</a> + <ul /> + </li> + <li> + <a href="Glossary.htm#section3">Scoping (or Lifecycle)</a> + <ul /> + </li> + <li> + <a href="Glossary.htm#section4">Profile</a> + <ul /> + </li> + <li> + <a href="Glossary.htm#section5">Interceptor</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="Concepts.htm">Software Design Concepts</a> + <ul> + <li> + <a href="Concepts.htm#section0">Design Concepts</a> + <ul /> + </li> + <li> + <a href="Concepts.htm#section1">Dependencies</a> + <ul /> + </li> + <li> + <a href="Concepts.htm#section2">Inversion of Control and Dependency Injection</a> + <ul /> + </li> + <li> + <a href="Concepts.htm#section3">Auto Wiring</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="DependencyInjection.htm">Dependency Injection</a> + <ul> + <li> + <a href="DependencyInjection.htm#section0">Dependency Injection</a> + <ul /> + </li> + <li> + <a href="DependencyInjection.htm#section1">Example Problem</a> + <ul /> + </li> + <li> + <a href="DependencyInjection.htm#section2">Constructor Injection</a> + <ul /> + </li> + <li> + <a href="DependencyInjection.htm#section3">Setter Injection</a> + <ul /> + </li> + <li> + <a href="DependencyInjection.htm#section4">Service Locator</a> + <ul /> + </li> + <li> + <a href="DependencyInjection.htm#section5">Good for More than Unit Testing</a> + <ul /> + </li> + <li> + <a href="DependencyInjection.htm#section6">Using a Dependency Injection Tool</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="InversionOfControl.htm">Inversion of Control</a> + <ul> + <li> + <a href="InversionOfControl.htm#section0">Real Life Example</a> + <ul /> + </li> + <li> + <a href="InversionOfControl.htm#section1">Refactoring to Inversion of Control</a> + <ul /> + </li> + <li> + <a href="InversionOfControl.htm#section2">Other Examples</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="ConfiguringStructureMap.htm">Configuring StructureMap</a> + <ul> + <li> + <a href="ConfiguringStructureMap.htm#section0">Forms of Configuration</a> + <ul /> + </li> + <li> + <a href="ConfiguringStructureMap.htm#section1">Initializing the Container</a> + <ul> + <li> + <a href="ConfiguringStructureMap.htm#section2">Using the App.Config File</a> + </li> + <li> + <a href="ConfiguringStructureMap.htm#section3">The StructureMap.config File</a> + </li> + </ul> + </li> + <li> + <a href="ConfiguringStructureMap.htm#section4">Where and How to Bootstrap StructureMap</a> + <ul> + <li> + <a href="ConfiguringStructureMap.htm#section5">Creating a Bootstrapper</a> + </li> + <li> + <a href="ConfiguringStructureMap.htm#section6">StructureMapConfiguration</a> + </li> + </ul> + </li> + </ul> + </li> + <li> + <a href="RegistryDSL.htm">Registry DSL</a> + <ul> + <li> + <a href="RegistryDSL.htm#section0">The Registry Class</a> + <ul> + <li> + <a href="RegistryDSL.htm#section1">Applying Registry Classes</a> + </li> + <li> + <a href="RegistryDSL.htm#section2">The Registry DSL Methods</a> + </li> + </ul> + </li> + <li> + <a href="RegistryDSL.htm#section3">Registering Types</a> + <ul> + <li> + <a href="RegistryDSL.htm#section4">Specifying the Default Instance for a PluginType</a> + </li> + <li> + <a href="RegistryDSL.htm#section5">Specifying Additional Instances for a PluginType</a> + </li> + <li> + <a href="RegistryDSL.htm#section6">Setting the Scoping/Lifecycle for a PluginType</a> + </li> + </ul> + </li> + <li> + <a href="RegistryDSL.htm#section7">Registering a "Missing Instance"</a> + <ul /> + </li> + <li> + <a href="RegistryDSL.htm#section8">Configuring Concrete Types</a> + <ul /> + </li> + <li> + <a href="RegistryDSL.htm#section9">Working with Open Generic Types</a> + <ul /> + </li> + <li> + <a href="RegistryDSL.htm#section10">Auto Registration and Assembly ScanningScanning</a> + <ul /> + </li> + <li> + <a href="RegistryDSL.htm#section11">Setter Injection Policies</a> + <ul /> + </li> + <li> + <a href="RegistryDSL.htm#section12">Interception</a> + <ul /> + </li> + <li> + <a href="RegistryDSL.htm#section13">Creating a Profile</a> + <ul /> + </li> + <li> + <a href="RegistryDSL.htm#section14">Using the Registry DSL Directly in Initializationlization</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="InstanceExpression.htm">Configuring Instances</a> + <ul> + <li> + <a href="InstanceExpression.htm#section0">Instance Expression</a> + <ul> + <li> + <a href="InstanceExpression.htm#section1">InstanceExpression Operations</a> + </li> + </ul> + </li> + <li> + <a href="InstanceExpression.htm#section2">Building with Constructors and Setters</a> + <ul> + <li> + <a href="InstanceExpression.htm#section3">Designating the Type</a> + </li> + <li> + <a href="InstanceExpression.htm#section4">Defining primitive constructor arguments</a> + </li> + <li> + <a href="InstanceExpression.htm#section5">Defining primitive setter properties</a> + </li> + <li> + <a href="InstanceExpression.htm#section6">Overriding Constructor Dependencies</a> + </li> + <li> + <a href="InstanceExpression.htm#section7">Overriding Setter Dependencies</a> + </li> + <li> + <a href="InstanceExpression.htm#section8">Array or Non Primitive Dependencies</a> + </li> + <li> + <a href="InstanceExpression.htm#section9">Primitive Arrays and Dictionaries</a> + </li> + </ul> + </li> + <li> + <a href="InstanceExpression.htm#section10">Using a Custom Instance</a> + <ul /> + </li> + <li> + <a href="InstanceExpression.htm#section11">Using an Externally Constructed Object</a> + <ul /> + </li> + <li> + <a href="InstanceExpression.htm#section12">Constructing Objects with Lambda Functions</a> + <ul /> + </li> + <li> + <a href="InstanceExpression.htm#section13">Referencing a Named Instance</a> + <ul /> + </li> + <li> + <a href="InstanceExpression.htm#section14">Using the Default Instance</a> + <ul /> + </li> + <li> + <a href="InstanceExpression.htm#section15">Specifying a Prototype Object with Cloning</a> + <ul /> + </li> + <li> + <a href="InstanceExpression.htm#section16">Specifying a Prototype Object with Serialization</a> + <ul /> + </li> + <li> + <a href="InstanceExpression.htm#section17">Configuring Conditional Construction</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="XmlConfiguration.htm">Xml Configuration</a> + <ul> + <li> + <a href="XmlConfiguration.htm#section0">&lt;StructureMap&gt; Element</a> + <ul> + <li> + <a href="XmlConfiguration.htm#section1">Configuring Instances</a> + </li> + </ul> + </li> + <li> + <a href="XmlConfiguration.htm#section2">Adding a Default Instance for a PluginType</a> + <ul /> + </li> + <li> + <a href="XmlConfiguration.htm#section3">Adding Additional Instances for a PluginType</a> + <ul /> + </li> + <li> + <a href="XmlConfiguration.htm#section4">Defining a Profile</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="XmlReference.htm">Xml Reference</a> + <ul> + <li> + <a href="XmlReference.htm#section0">&lt;StructureMap&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section1">&lt;Include&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section2">&lt;Assembly&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section3">&lt;Instances&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section4">&lt;Machine&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section5">&lt;PluginFamily&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section6">&lt;DefaultInstance&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section7">&lt;Profile&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section8">&lt;Instance&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section9">&lt;Interceptors&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section10">&lt;Interceptor&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section11">&lt;Override&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section12">&lt;Plugin&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section13">&lt;Setter&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section14">&lt;Source&gt; Element</a> + <ul /> + </li> + <li> + <a href="XmlReference.htm#section15">&lt;Property&gt; Element</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="NodeNormalized.htm">Node Normalized Instances</a> + <ul> + <li> + <a href="NodeNormalized.htm#section0">Instance Root Node</a> + <ul /> + </li> + <li> + <a href="NodeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a> + <ul /> + </li> + <li> + <a href="NodeNormalized.htm#section2">Long Strings</a> + <ul /> + </li> + <li> + <a href="NodeNormalized.htm#section3">Enumeration Properties</a> + <ul /> + </li> + <li> + <a href="NodeNormalized.htm#section4">Dependency Properties</a> + <ul> + <li> + <a href="NodeNormalized.htm#section5">Inline Definition</a> + </li> + <li> + <a href="NodeNormalized.htm#section6">Reference Definition</a> + </li> + </ul> + </li> + </ul> + </li> + <li> + <a href="AttributeNormalized.htm">Attribute Normalized Instances</a> + <ul> + <li> + <a href="AttributeNormalized.htm#section0">Instance Root Node</a> + <ul /> + </li> + <li> + <a href="AttributeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a> + <ul /> + </li> + <li> + <a href="AttributeNormalized.htm#section2">Long Strings</a> + <ul /> + </li> + <li> + <a href="AttributeNormalized.htm#section3">Enumeration Properties</a> + <ul /> + </li> + <li> + <a href="AttributeNormalized.htm#section4">Dependency Properties</a> + <ul> + <li> + <a href="AttributeNormalized.htm#section5">Inline Definition</a> + </li> + <li> + <a href="AttributeNormalized.htm#section6">Reference Definition</a> + </li> + </ul> + </li> + <li> + <a href="AttributeNormalized.htm#section7">Non Primitive Array Property</a> + <ul /> + </li> + <li> + <a href="AttributeNormalized.htm#section8">Primitive Arrays</a> + <ul /> + </li> + <li> + <a href="AttributeNormalized.htm#section9">Dictionaries and NameValueCollection</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="ScanningAssemblies.htm">Auto Registration and Type Scanning</a> + <ul> + <li> + <a href="ScanningAssemblies.htm#section0">Using the Scan() Expression</a> + <ul /> + </li> + <li> + <a href="ScanningAssemblies.htm#section1">Rules for Auto Registering a Type</a> + <ul /> + </li> + <li> + <a href="ScanningAssemblies.htm#section2">Designating Assemblies </a> + <ul /> + </li> + <li> + <a href="ScanningAssemblies.htm#section3">Scan all Assemblies in a Given Folder</a> + <ul /> + </li> + <li> + <a href="ScanningAssemblies.htm#section4">Add All Concrete Types for a PluginType</a> + <ul /> + </li> + <li> + <a href="ScanningAssemblies.htm#section5">Excluding or Including Types</a> + <ul /> + </li> + <li> + <a href="ScanningAssemblies.htm#section6">Type Scanning with Attributes</a> + <ul /> + </li> + <li> + <a href="ScanningAssemblies.htm#section7">Convention Based Type Registration</a> + <ul> + <li> + <a href="ScanningAssemblies.htm#section8">The Default Convention</a> + </li> + <li> + <a href="ScanningAssemblies.htm#section9">Registering Types by Name</a> + </li> + <li> + <a href="ScanningAssemblies.htm#section10">Creating and Using Your Own Convention</a> + </li> + </ul> + </li> + <li> + <a href="ScanningAssemblies.htm#section11">Looking for Registries</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="Scoping.htm">Scoping, Caching, and Lifecycle Management</a> + <ul> + <li> + <a href="Scoping.htm#section0">Setting the Scope in the Registry DSL</a> + <ul /> + </li> + <li> + <a href="Scoping.htm#section1">Setting the Scope in the Xml Configuration</a> + <ul /> + </li> + <li> + <a href="Scoping.htm#section2">Setting the Scope with the PluginFamily Attribute</a> + <ul /> + </li> + <li> + <a href="Scoping.htm#section3">Using a Custom Scope/Lifecycle</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="UsingAttributes.htm">Using Attributes</a> + <ul> + <li> + <a href="UsingAttributes.htm#section0">Scanning for Classes marked with Attributes</a> + <ul /> + </li> + <li> + <a href="UsingAttributes.htm#section1">[DefaultConstructor] Attribute</a> + <ul /> + </li> + <li> + <a href="UsingAttributes.htm#section2">[PluginFamily] Attribute</a> + <ul /> + </li> + <li> + <a href="UsingAttributes.htm#section3">[Pluggable] Attribute</a> + <ul /> + </li> + <li> + <a href="UsingAttributes.htm#section4">[SetterProperty] Attribute</a> + <ul /> + </li> + <li> + <a href="UsingAttributes.htm#section5">[ValidationMethod] Attribute</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="Profiles.htm">Profiles</a> + <ul /> + </li> + <li> + <a href="Interception.htm">Interception</a> + <ul> + <li> + <a href="Interception.htm#section0">Intercept a Single Instance</a> + <ul> + <li> + <a href="Interception.htm#section1">Run an Action Against an Object</a> + </li> + <li> + <a href="Interception.htm#section2">Wrap or Substitute the Returned Object</a> + </li> + <li> + <a href="Interception.htm#section3">With a Custom Interceptor</a> + </li> + </ul> + </li> + <li> + <a href="Interception.htm#section4">Apply Interception to all Instances of a PluginType</a> + <ul /> + </li> + <li> + <a href="Interception.htm#section5">Apply Interception to all Types Matching a Criteria</a> + <ul /> + </li> + <li> + <a href="Interception.htm#section6">Creating a Custom Type Interceptor</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="ChangingConfigurationAtRuntime.htm">Changing Configuration at Runtime</a> + <ul> + <li> + <a href="ChangingConfigurationAtRuntime.htm#section0">Adding Configuration to an Existing Container</a> + <ul /> + </li> + <li> + <a href="ChangingConfigurationAtRuntime.htm#section1">Injecting a Single Service at Runtime</a> + <ul /> + </li> + <li> + <a href="ChangingConfigurationAtRuntime.htm#section2">Injecting a Mock or a Stub at Runtime</a> + <ul /> + </li> + <li> + <a href="ChangingConfigurationAtRuntime.htm#section3">Ejecting all Instances of a PluginType</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="RetrievingServices.htm">Retrieving Services</a> + <ul> + <li> + <a href="RetrievingServices.htm#section0">Get a Service by PluginType</a> + <ul /> + </li> + <li> + <a href="RetrievingServices.htm#section1">Get a Service by PluginType and Name</a> + <ul /> + </li> + <li> + <a href="RetrievingServices.htm#section2">Get all Instances of a PluginType</a> + <ul /> + </li> + <li> + <a href="RetrievingServices.htm#section3">"Fill" all of the Dependencies of a Concrete Class</a> + <ul /> + </li> + <li> + <a href="RetrievingServices.htm#section4">Passing Arguments to StructureMap at Runtime</a> + <ul /> + </li> + <li> + <a href="RetrievingServices.htm#section5">"Try" to Get an Instance</a> + <ul /> + </li> + </ul> + </li> + <li> + <a href="AutoMocker.htm">Using the StructureMap AutoMocker</a> + <ul> + <li> + <a href="AutoMocker.htm#section0">How it Works</a> + <ul /> + </li> + <li> + <a href="AutoMocker.htm#section1">How it uses Mock Engines</a> + <ul /> + </li> + <li> + <a href="AutoMocker.htm#section2">Supplying Mocks or Stubs to the AutoMocker</a> + <ul /> + </li> + <li> + <a href="AutoMocker.htm#section3">Partial Mock the ClassU... [truncated message content] |
From: <jer...@us...> - 2009-01-19 18:49:36
|
Revision: 224 http://structuremap.svn.sourceforge.net/structuremap/?rev=224&view=rev Author: jeremydmiller Date: 2009-01-19 18:49:29 +0000 (Mon, 19 Jan 2009) Log Message: ----------- some new cleanup methods Modified Paths: -------------- trunk/Source/CommonAssemblyInfo.cs trunk/Source/HTML/QuickStart.htm trunk/Source/HTML/ToC-Bullet-List.xml trunk/Source/HTML/structuremap.js trunk/Source/StructureMap/Container.cs trunk/Source/StructureMap/ExplicitArgsExpression.cs trunk/Source/StructureMap/IContainer.cs trunk/Source/StructureMap/Pipeline/CacheInterceptor.cs trunk/Source/StructureMap/Pipeline/HttpContextBuildPolicy.cs trunk/Source/StructureMap/Pipeline/HybridBuildPolicy.cs trunk/Source/StructureMap/Pipeline/IBuildInterceptor.cs trunk/Source/StructureMap/Pipeline/SingletonPolicy.cs trunk/Source/StructureMap/Pipeline/ThreadLocalStoragePolicy.cs trunk/Source/StructureMap/Util/Cache.cs trunk/Source/StructureMap.Testing/Graph/ContainerTester.cs trunk/Source/StructureMap.Testing/Graph/TestExplicitArguments.cs trunk/Source/TableOfContentsBuilder/Program.cs trunk/cruise.build Modified: trunk/Source/CommonAssemblyInfo.cs =================================================================== --- trunk/Source/CommonAssemblyInfo.cs 2009-01-15 16:02:34 UTC (rev 223) +++ trunk/Source/CommonAssemblyInfo.cs 2009-01-19 18:49:29 UTC (rev 224) @@ -13,11 +13,11 @@ //------------------------------------------------------------------------------ [assembly: ComVisibleAttribute(false)] -[assembly: AssemblyVersionAttribute("2.5.2.0000")] +[assembly: AssemblyVersionAttribute("2.5.3.0000")] [assembly: AssemblyCopyrightAttribute("Copyright (c) 2003-2008, Jeremy D. Miller")] [assembly: AssemblyProductAttribute("StructureMap")] [assembly: AssemblyCompanyAttribute("")] [assembly: AssemblyConfigurationAttribute("release")] -[assembly: AssemblyInformationalVersionAttribute("2.5.2.0000")] -[assembly: AssemblyFileVersionAttribute("2.5.2.0000")] +[assembly: AssemblyInformationalVersionAttribute("2.5.3.0000")] +[assembly: AssemblyFileVersionAttribute("2.5.3.0000")] Modified: trunk/Source/HTML/QuickStart.htm =================================================================== --- trunk/Source/HTML/QuickStart.htm 2009-01-15 16:02:34 UTC (rev 223) +++ trunk/Source/HTML/QuickStart.htm 2009-01-19 18:49:29 UTC (rev 224) @@ -10,15 +10,15 @@ <body> <p> - The most general question I get with StructureMap is “how do I get started?” - I’d recommend that you first get comfortable + The most general question I get with StructureMap is "how do I get started?" + I'd recommend that you first get comfortable <a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/06/29/some-concepts-to-know-first.aspx"> with some concepts</a> and the basic patterns of <a href="http://codebetter.com/blogs/jeremy.miller/archive/2005/10/06/132825.aspx"> Dependency Injection</a> and <a href="http://codebetter.com/blogs/jeremy.miller/archive/2005/09/20/132290.aspx"> - Inversion of Control</a>. Assuming that you’re already familiar with those - concepts, or you’d really rather skip the pedantry and jump right into concrete + Inversion of Control</a>. Assuming that you're already familiar with those + concepts, or you'd really rather skip the pedantry and jump right into concrete code, the first thing to do is go download StructureMap and jump into usage (then come back to the patterns and pedantry). </p> @@ -43,7 +43,7 @@ <li>StructureMap is actually the oldest IoC tool for .Net, with the first production release coming in June of 2004 </li> <li>The source code is accessible - <a href="https://structuremap.svn.sourceforge.net/svnroot/structuremap/trunk">here via Subversion</a> in case you’re curious. No credentials are required to + <a href="https://structuremap.svn.sourceforge.net/svnroot/structuremap/trunk">here via Subversion</a> in case you're curious. No credentials are required to access the source code. </li> <li>Right now, StructureMap 2.5 will run on .Net 3.5 only. I will most likely NOT be backporting the new version to 2.0 because of extensive usage of 3.5 features @@ -57,11 +57,11 @@ Your interaction with StructureMap is going to mostly consist of two activities:</p> <ol> <li>Asking StructureMap for an instance of a service or dependency (the easy part) </li> - <li>Registering “what” and “how” StructureMap should build or find those requested - services (the tedious part, but it’s gotten much better over the years) </li> + <li>Registering "what" and "how" StructureMap should build or find those requested + services (the tedious part, but it's gotten much better over the years) </li> </ol> <p> - In our system we use a service called “IValidator” to exercise validation rules + In our system we use a service called "IValidator" to exercise validation rules on our domain model objects (I talked about the approach <a href="http://codebetter.com/blogs/jeremy.miller/archive/2007/06/13/build-your-own-cab-part-9-domain-centric-validation-with-the-notification-pattern.aspx"> here</a>). By default, we want any consumer of the IValidator interface to @@ -148,10 +148,10 @@ }</p> </div> <p> - That’s it, your first usage of StructureMap. No messy Xml configuration, + That's it, your first usage of StructureMap. No messy Xml configuration, no attributes scattered through your code, just a couple lines of bootstrapping - code. Of course, if that’s all StructureMap did, it wouldn’t be - worth your time to download it. Let’s look at a bit more advanced example.</p> + code. Of course, if that's all StructureMap did, it wouldn't be + worth your time to download it. Let's look at a bit more advanced example.</p> <hr /> <h2> Primitive Arguments</h2> @@ -159,7 +159,7 @@ I actually like to <a href="http://structuremap.sourceforge.net/ConfigurationManagement.htm">use StructureMap as a generic configuration tool</a> (which was actually its - original purpose). Let’s say you’re moving to the data access code. + original purpose). Let's say you're moving to the data access code. You come up with some sort of <a href="http://martinfowler.com/eaaCatalog/repository.html">Repository</a> pattern class like this:</p> @@ -212,7 +212,7 @@ }</p> </div> <p> - The Repository class needs to be supplied with the “connectionString” in its + The Repository class needs to be supplied with the "connectionString" in its constructor. No problem, just set up the value of the constructor argument in the bootstrapping:</p> <div style="BORDER-RIGHT: black thin solid; BORDER-TOP: black thin solid; FONT-SIZE: 10pt; BACKGROUND: white; OVERFLOW: scroll; BORDER-LEFT: black thin solid; COLOR: black; BORDER-BOTTOM: black thin solid; FONT-FAMILY: courier new"> @@ -260,10 +260,10 @@ style="COLOR: #2b91af">IRepository</span>>();</p> </div> <p> - StructureMap will look up the “CONNECTION-STRING” value in the AppSettings + StructureMap will look up the "CONNECTION-STRING" value in the AppSettings portion of the App.config file, and use that string value to invoke the constructor function of the Repository class, then hand back that new Repository - object. Woo hoo. We can build an object that doesn’t depend on + object. Woo hoo. We can build an object that doesn't depend on anything, and we can build an object that needs some strings in its constructor function. How about objects that need other non-primitive objects?</p> <hr /> @@ -271,15 +271,15 @@ Auto Wiring</h2> <p> In the code samples above, I used StructureMap as a Service Locator in the - ClassThatGetsAnIValidator.SaveObject() method. Typically, you’ll try to + ClassThatGetsAnIValidator.SaveObject() method. Typically, you'll try to minimize the number of service locator usages in your system to a bare minimum - (I found 8 in my current system, but I think I’ll find a way to prune half of + (I found 8 in my current system, but I think I'll find a way to prune half of those later). Most of the value of an IoC tool is in automatically doing - Dependency Injection. I’m working with the new MVC framework at the - moment, so it’s a handy sample. Let’s say that we have a Controller class + Dependency Injection. I'm working with the new MVC framework at the + moment, so it's a handy sample. Let's say that we have a Controller class for a typical CRUD screen. That Controller class will generally need to interact with both validation services and the data access functionality of the - Repository. Here’s a representative Controller class:</p> + Repository. Here's a representative Controller class:</p> <div style="BORDER-RIGHT: black thin solid; BORDER-TOP: black thin solid; FONT-SIZE: 10pt; BACKGROUND: white; OVERFLOW: scroll; BORDER-LEFT: black thin solid; COLOR: black; BORDER-BOTTOM: black thin solid; FONT-FAMILY: courier new"> <p style="MARGIN: 0px"> <span style="COLOR: blue">public</span> <span style="COLOR: blue">class</span> @@ -318,7 +318,7 @@ }</p> </div> <p> - So let’s get StructureMap set up for this SomeScreenController class:</p> + So let's get StructureMap set up for this SomeScreenController class:</p> <div style="BORDER-RIGHT: black thin solid; BORDER-TOP: black thin solid; FONT-SIZE: 10pt; BACKGROUND: white; OVERFLOW: scroll; BORDER-LEFT: black thin solid; COLOR: black; BORDER-BOTTOM: black thin solid; FONT-FAMILY: courier new"> <p style="MARGIN: 0px"> <span style="COLOR: #2b91af"> @@ -349,7 +349,7 @@ });</p> </div> <p> - You’ll notice that we didn’t make any explicit configuration for the + You'll notice that we didn't make any explicit configuration for the SomeScreenController class, but yet we could now call:</p> <div style="BORDER-RIGHT: black thin solid; BORDER-TOP: black thin solid; FONT-SIZE: 10pt; BACKGROUND: white; OVERFLOW: scroll; BORDER-LEFT: black thin solid; COLOR: black; BORDER-BOTTOM: black thin solid; FONT-FAMILY: courier new"> <p style="MARGIN: 0px"> @@ -361,17 +361,17 @@ and StructureMap will happily create a new instance of the SomeScreenController class by invoking its constructor and passing in a new Validator object and a new Repository object created with the connection string from the App.config - file. We didn’t need to tell StructureMap how to construct + file. We didn't need to tell StructureMap how to construct SomeScreenController because: </p> <ul> <li>StructureMap can look at the constructor function of SomeScreenController and see that it depends on IValidator and IRepository </li> - <li>StructureMap “knows” about the default way to create and return an IValidator + <li>StructureMap "knows" about the default way to create and return an IValidator and an IRepository </li> </ul> <p> - This feature is known as “auto wiring,” and all the mainstream IoC containers + This feature is known as "auto wiring," and all the mainstream IoC containers support this feature to some extent or another. </p> <hr /> @@ -379,13 +379,13 @@ What to do when things go wrong?</h2> <p> StructureMap, and any other IoC tool for that matter, is configuration intensive - – which means that their will be problems in that configuration. We’re all + – which means that their will be problems in that configuration. We're all moving to more convention based type registration – which means that more stuff is happening off stage and out of your sight, making debugging the configuration even trickier. Not to worry (too much), StructureMap has some diagnostic abilities to help you solve configuration problems. The quickest tool is to ask a Container object or ObjectFactory (which is just a static wrapper - around a Container) “what do you have?” with the Container.WhatDoIHave() method + around a Container) "what do you have?" with the Container.WhatDoIHave() method like this below:</p> <div style="BORDER-RIGHT: black thin solid; BORDER-TOP: black thin solid; FONT-SIZE: 10pt; BACKGROUND: white; OVERFLOW: scroll; BORDER-LEFT: black thin solid; COLOR: black; BORDER-BOTTOM: black thin solid; FONT-FAMILY: courier new"> <p style="MARGIN: 0px"> @@ -440,7 +440,7 @@ <p> which is admittedly, not the prettiest looking thing in the world.</p> <p> - You can also “assert” that the configuration for a Container or ObjectFactory is + You can also "assert" that the configuration for a Container or ObjectFactory is complete by calling the Container.AssertConfigurationIsValid() method like this sample below:</p> <div style="BORDER-RIGHT: black thin solid; BORDER-TOP: black thin solid; FONT-SIZE: 10pt; BACKGROUND: white; OVERFLOW: scroll; BORDER-LEFT: black thin solid; COLOR: black; BORDER-BOTTOM: black thin solid; FONT-FAMILY: courier new"> @@ -479,7 +479,7 @@ <ol> <li>Look for any missing constructor or mandatory setter arguments </li> <li>Look for any unknown dependency types </li> - <li>Look for any errors in the Xml configuration (if you’re using Xml configuration) + <li>Look for any errors in the Xml configuration (if you're using Xml configuration) </li> <li>Try to build each and every type and named instance in the configuration – i.e. this is a complete, but relatively expensive operation </li> @@ -488,8 +488,8 @@ feature that is unique to StructureMap as far as I know</a>) </li> </ol> <p> - The previous sample is a valid configuration, but let’s look at an invalid - configuration. Let’s omit the configuration of the “connectionString” + The previous sample is a valid configuration, but let's look at an invalid + configuration. Let's omit the configuration of the "connectionString" constructor argument for the Repository class and try AssertConfigurationIsValid():</p> <div style="BORDER-RIGHT: black thin solid; BORDER-TOP: black thin solid; FONT-SIZE: 10pt; BACKGROUND: white; OVERFLOW: scroll; BORDER-LEFT: black thin solid; COLOR: black; BORDER-BOTTOM: black thin solid; FONT-FAMILY: courier new"> @@ -534,8 +534,8 @@ StructureMap.StructureMapException: StructureMap Exception Code: 205 Missing requested Instance property "connectionString" for InstanceKey "73b7f21b-bbfd-462c-854d-5b2a2f98ba50"</pre> <p> - which again, isn’t the prettiest thing in the world, but it does tell me that - the “connectionString” argument is missing for the Repository class. After + which again, isn't the prettiest thing in the world, but it does tell me that + the "connectionString" argument is missing for the Repository class. After seeing this output, I think that this output and error wording will get improved in an upcoming release.</p> <hr /> Modified: trunk/Source/HTML/ToC-Bullet-List.xml =================================================================== --- trunk/Source/HTML/ToC-Bullet-List.xml 2009-01-15 16:02:34 UTC (rev 223) +++ trunk/Source/HTML/ToC-Bullet-List.xml 2009-01-19 18:49:29 UTC (rev 224) @@ -1,834 +1,834 @@ <div> <ul> <li> - <a href="default.htm">Home</a> + <a href="http://structuremap.sourceforge.net/default.htm">Home</a> <ul> <li> - <a href="default.htm#section0">Status</a> + <a href="http://structuremap.sourceforge.net/default.htm#section0">Status</a> <ul /> </li> <li> - <a href="default.htm#section1">Related Links:</a> + <a href="http://structuremap.sourceforge.net/default.htm#section1">Related Links:</a> <ul /> </li> </ul> </li> <li> - <a href="FeatureList.htm">Feature List</a> + <a href="http://structuremap.sourceforge.net/FeatureList.htm">Feature List</a> <ul /> </li> <li> - <a href="QuickStart.htm">A Gentle Quickstart</a> + <a href="http://structuremap.sourceforge.net/QuickStart.htm">A Gentle Quickstart</a> <ul> <li> - <a href="QuickStart.htm#section0">Salient Facts</a> + <a href="http://structuremap.sourceforge.net/QuickStart.htm#section0">Salient Facts</a> <ul /> </li> <li> - <a href="QuickStart.htm#section1">The Simplest Possible Usage of StructureMap</a> + <a href="http://structuremap.sourceforge.net/QuickStart.htm#section1">The Simplest Possible Usage of StructureMap</a> <ul /> </li> <li> - <a href="QuickStart.htm#section2">Primitive Arguments</a> + <a href="http://structuremap.sourceforge.net/QuickStart.htm#section2">Primitive Arguments</a> <ul /> </li> <li> - <a href="QuickStart.htm#section3">Auto Wiring</a> + <a href="http://structuremap.sourceforge.net/QuickStart.htm#section3">Auto Wiring</a> <ul /> </li> <li> - <a href="QuickStart.htm#section4">What to do when things go wrong?</a> + <a href="http://structuremap.sourceforge.net/QuickStart.htm#section4">What to do when things go wrong?</a> <ul /> </li> </ul> </li> <li> - <a href="Glossary.htm">Glossary</a> + <a href="http://structuremap.sourceforge.net/Glossary.htm">Glossary</a> <ul> <li> - <a href="Glossary.htm#section0">Container</a> + <a href="http://structuremap.sourceforge.net/Glossary.htm#section0">Container</a> <ul /> </li> <li> - <a href="Glossary.htm#section1">PluginType &amp; PluggedType</a> + <a href="http://structuremap.sourceforge.net/Glossary.htm#section1">PluginType &amp; PluggedType</a> <ul /> </li> <li> - <a href="Glossary.htm#section2">Instance</a> + <a href="http://structuremap.sourceforge.net/Glossary.htm#section2">Instance</a> <ul /> </li> <li> - <a href="Glossary.htm#section3">Scoping (or Lifecycle)</a> + <a href="http://structuremap.sourceforge.net/Glossary.htm#section3">Scoping (or Lifecycle)</a> <ul /> </li> <li> - <a href="Glossary.htm#section4">Profile</a> + <a href="http://structuremap.sourceforge.net/Glossary.htm#section4">Profile</a> <ul /> </li> <li> - <a href="Glossary.htm#section5">Interceptor</a> + <a href="http://structuremap.sourceforge.net/Glossary.htm#section5">Interceptor</a> <ul /> </li> </ul> </li> <li> - <a href="Concepts.htm">Software Design Concepts</a> + <a href="http://structuremap.sourceforge.net/Concepts.htm">Software Design Concepts</a> <ul> <li> - <a href="Concepts.htm#section0">Design Concepts</a> + <a href="http://structuremap.sourceforge.net/Concepts.htm#section0">Design Concepts</a> <ul /> </li> <li> - <a href="Concepts.htm#section1">Dependencies</a> + <a href="http://structuremap.sourceforge.net/Concepts.htm#section1">Dependencies</a> <ul /> </li> <li> - <a href="Concepts.htm#section2">Inversion of Control and Dependency Injection</a> + <a href="http://structuremap.sourceforge.net/Concepts.htm#section2">Inversion of Control and Dependency Injection</a> <ul /> </li> <li> - <a href="Concepts.htm#section3">Auto Wiring</a> + <a href="http://structuremap.sourceforge.net/Concepts.htm#section3">Auto Wiring</a> <ul /> </li> </ul> </li> <li> - <a href="DependencyInjection.htm">Dependency Injection</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm">Dependency Injection</a> <ul> <li> - <a href="DependencyInjection.htm#section0">Dependency Injection</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm#section0">Dependency Injection</a> <ul /> </li> <li> - <a href="DependencyInjection.htm#section1">Example Problem</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm#section1">Example Problem</a> <ul /> </li> <li> - <a href="DependencyInjection.htm#section2">Constructor Injection</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm#section2">Constructor Injection</a> <ul /> </li> <li> - <a href="DependencyInjection.htm#section3">Setter Injection</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm#section3">Setter Injection</a> <ul /> </li> <li> - <a href="DependencyInjection.htm#section4">Service Locator</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm#section4">Service Locator</a> <ul /> </li> <li> - <a href="DependencyInjection.htm#section5">Good for More than Unit Testing</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm#section5">Good for More than Unit Testing</a> <ul /> </li> <li> - <a href="DependencyInjection.htm#section6">Using a Dependency Injection Tool</a> + <a href="http://structuremap.sourceforge.net/DependencyInjection.htm#section6">Using a Dependency Injection Tool</a> <ul /> </li> </ul> </li> <li> - <a href="InversionOfControl.htm">Inversion of Control</a> + <a href="http://structuremap.sourceforge.net/InversionOfControl.htm">Inversion of Control</a> <ul> <li> - <a href="InversionOfControl.htm#section0">Real Life Example</a> + <a href="http://structuremap.sourceforge.net/InversionOfControl.htm#section0">Real Life Example</a> <ul /> </li> <li> - <a href="InversionOfControl.htm#section1">Refactoring to Inversion of Control</a> + <a href="http://structuremap.sourceforge.net/InversionOfControl.htm#section1">Refactoring to Inversion of Control</a> <ul /> </li> <li> - <a href="InversionOfControl.htm#section2">Other Examples</a> + <a href="http://structuremap.sourceforge.net/InversionOfControl.htm#section2">Other Examples</a> <ul /> </li> </ul> </li> <li> - <a href="ConfiguringStructureMap.htm">Configuring StructureMap</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm">Configuring StructureMap</a> <ul> <li> - <a href="ConfiguringStructureMap.htm#section0">Forms of Configuration</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm#section0">Forms of Configuration</a> <ul /> </li> <li> - <a href="ConfiguringStructureMap.htm#section1">Initializing the Container</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm#section1">Initializing the Container</a> <ul> <li> - <a href="ConfiguringStructureMap.htm#section2">Using the App.Config File</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm#section2">Using the App.Config File</a> </li> <li> - <a href="ConfiguringStructureMap.htm#section3">The StructureMap.config File</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm#section3">The StructureMap.config File</a> </li> </ul> </li> <li> - <a href="ConfiguringStructureMap.htm#section4">Where and How to Bootstrap StructureMap</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm#section4">Where and How to Bootstrap StructureMap</a> <ul> <li> - <a href="ConfiguringStructureMap.htm#section5">Creating a Bootstrapper</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm#section5">Creating a Bootstrapper</a> </li> <li> - <a href="ConfiguringStructureMap.htm#section6">StructureMapConfiguration</a> + <a href="http://structuremap.sourceforge.net/ConfiguringStructureMap.htm#section6">StructureMapConfiguration</a> </li> </ul> </li> </ul> </li> <li> - <a href="RegistryDSL.htm">Registry DSL</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm">Registry DSL</a> <ul> <li> - <a href="RegistryDSL.htm#section0">The Registry Class</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section0">The Registry Class</a> <ul> <li> - <a href="RegistryDSL.htm#section1">Applying Registry Classes</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section1">Applying Registry Classes</a> </li> <li> - <a href="RegistryDSL.htm#section2">The Registry DSL Methods</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section2">The Registry DSL Methods</a> </li> </ul> </li> <li> - <a href="RegistryDSL.htm#section3">Registering Types</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section3">Registering Types</a> <ul> <li> - <a href="RegistryDSL.htm#section4">Specifying the Default Instance for a PluginType</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section4">Specifying the Default Instance for a PluginType</a> </li> <li> - <a href="RegistryDSL.htm#section5">Specifying Additional Instances for a PluginType</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section5">Specifying Additional Instances for a PluginType</a> </li> <li> - <a href="RegistryDSL.htm#section6">Setting the Scoping/Lifecycle for a PluginType</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section6">Setting the Scoping/Lifecycle for a PluginType</a> </li> </ul> </li> <li> - <a href="RegistryDSL.htm#section7">Registering a "Missing Instance"</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section7">Registering a "Missing Instance"</a> <ul /> </li> <li> - <a href="RegistryDSL.htm#section8">Configuring Concrete Types</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section8">Configuring Concrete Types</a> <ul /> </li> <li> - <a href="RegistryDSL.htm#section9">Working with Open Generic Types</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section9">Working with Open Generic Types</a> <ul /> </li> <li> - <a href="RegistryDSL.htm#section10">Auto Registration and Assembly ScanningScanning</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section10">Auto Registration and Assembly ScanningScanning</a> <ul /> </li> <li> - <a href="RegistryDSL.htm#section11">Setter Injection Policies</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section11">Setter Injection Policies</a> <ul /> </li> <li> - <a href="RegistryDSL.htm#section12">Interception</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section12">Interception</a> <ul /> </li> <li> - <a href="RegistryDSL.htm#section13">Creating a Profile</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section13">Creating a Profile</a> <ul /> </li> <li> - <a href="RegistryDSL.htm#section14">Using the Registry DSL Directly in Initializationlization</a> + <a href="http://structuremap.sourceforge.net/RegistryDSL.htm#section14">Using the Registry DSL Directly in Initializationlization</a> <ul /> </li> </ul> </li> <li> - <a href="InstanceExpression.htm">Configuring Instances</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm">Configuring Instances</a> <ul> <li> - <a href="InstanceExpression.htm#section0">Instance Expression</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section0">Instance Expression</a> <ul> <li> - <a href="InstanceExpression.htm#section1">InstanceExpression Operations</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section1">InstanceExpression Operations</a> </li> </ul> </li> <li> - <a href="InstanceExpression.htm#section2">Building with Constructors and Setters</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section2">Building with Constructors and Setters</a> <ul> <li> - <a href="InstanceExpression.htm#section3">Designating the Type</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section3">Designating the Type</a> </li> <li> - <a href="InstanceExpression.htm#section4">Defining primitive constructor arguments</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section4">Defining primitive constructor arguments</a> </li> <li> - <a href="InstanceExpression.htm#section5">Defining primitive setter properties</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section5">Defining primitive setter properties</a> </li> <li> - <a href="InstanceExpression.htm#section6">Overriding Constructor Dependencies</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section6">Overriding Constructor Dependencies</a> </li> <li> - <a href="InstanceExpression.htm#section7">Overriding Setter Dependencies</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section7">Overriding Setter Dependencies</a> </li> <li> - <a href="InstanceExpression.htm#section8">Array or Non Primitive Dependencies</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section8">Array or Non Primitive Dependencies</a> </li> <li> - <a href="InstanceExpression.htm#section9">Primitive Arrays and Dictionaries</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section9">Primitive Arrays and Dictionaries</a> </li> </ul> </li> <li> - <a href="InstanceExpression.htm#section10">Using a Custom Instance</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section10">Using a Custom Instance</a> <ul /> </li> <li> - <a href="InstanceExpression.htm#section11">Using an Externally Constructed Object</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section11">Using an Externally Constructed Object</a> <ul /> </li> <li> - <a href="InstanceExpression.htm#section12">Constructing Objects with Lambda Functions</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section12">Constructing Objects with Lambda Functions</a> <ul /> </li> <li> - <a href="InstanceExpression.htm#section13">Referencing a Named Instance</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section13">Referencing a Named Instance</a> <ul /> </li> <li> - <a href="InstanceExpression.htm#section14">Using the Default Instance</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section14">Using the Default Instance</a> <ul /> </li> <li> - <a href="InstanceExpression.htm#section15">Specifying a Prototype Object with Cloning</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section15">Specifying a Prototype Object with Cloning</a> <ul /> </li> <li> - <a href="InstanceExpression.htm#section16">Specifying a Prototype Object with Serialization</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section16">Specifying a Prototype Object with Serialization</a> <ul /> </li> <li> - <a href="InstanceExpression.htm#section17">Configuring Conditional Construction</a> + <a href="http://structuremap.sourceforge.net/InstanceExpression.htm#section17">Configuring Conditional Construction</a> <ul /> </li> </ul> </li> <li> - <a href="XmlConfiguration.htm">Xml Configuration</a> + <a href="http://structuremap.sourceforge.net/XmlConfiguration.htm">Xml Configuration</a> <ul> <li> - <a href="XmlConfiguration.htm#section0">&lt;StructureMap&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlConfiguration.htm#section0">&lt;StructureMap&gt; Element</a> <ul> <li> - <a href="XmlConfiguration.htm#section1">Configuring Instances</a> + <a href="http://structuremap.sourceforge.net/XmlConfiguration.htm#section1">Configuring Instances</a> </li> </ul> </li> <li> - <a href="XmlConfiguration.htm#section2">Adding a Default Instance for a PluginType</a> + <a href="http://structuremap.sourceforge.net/XmlConfiguration.htm#section2">Adding a Default Instance for a PluginType</a> <ul /> </li> <li> - <a href="XmlConfiguration.htm#section3">Adding Additional Instances for a PluginType</a> + <a href="http://structuremap.sourceforge.net/XmlConfiguration.htm#section3">Adding Additional Instances for a PluginType</a> <ul /> </li> <li> - <a href="XmlConfiguration.htm#section4">Defining a Profile</a> + <a href="http://structuremap.sourceforge.net/XmlConfiguration.htm#section4">Defining a Profile</a> <ul /> </li> </ul> </li> <li> - <a href="XmlReference.htm">Xml Reference</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm">Xml Reference</a> <ul> <li> - <a href="XmlReference.htm#section0">&lt;StructureMap&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section0">&lt;StructureMap&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section1">&lt;Include&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section1">&lt;Include&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section2">&lt;Assembly&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section2">&lt;Assembly&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section3">&lt;Instances&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section3">&lt;Instances&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section4">&lt;Machine&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section4">&lt;Machine&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section5">&lt;PluginFamily&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section5">&lt;PluginFamily&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section6">&lt;DefaultInstance&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section6">&lt;DefaultInstance&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section7">&lt;Profile&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section7">&lt;Profile&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section8">&lt;Instance&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section8">&lt;Instance&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section9">&lt;Interceptors&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section9">&lt;Interceptors&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section10">&lt;Interceptor&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section10">&lt;Interceptor&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section11">&lt;Override&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section11">&lt;Override&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section12">&lt;Plugin&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section12">&lt;Plugin&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section13">&lt;Setter&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section13">&lt;Setter&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section14">&lt;Source&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section14">&lt;Source&gt; Element</a> <ul /> </li> <li> - <a href="XmlReference.htm#section15">&lt;Property&gt; Element</a> + <a href="http://structuremap.sourceforge.net/XmlReference.htm#section15">&lt;Property&gt; Element</a> <ul /> </li> </ul> </li> <li> - <a href="NodeNormalized.htm">Node Normalized Instances</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm">Node Normalized Instances</a> <ul> <li> - <a href="NodeNormalized.htm#section0">Instance Root Node</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm#section0">Instance Root Node</a> <ul /> </li> <li> - <a href="NodeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a> <ul /> </li> <li> - <a href="NodeNormalized.htm#section2">Long Strings</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm#section2">Long Strings</a> <ul /> </li> <li> - <a href="NodeNormalized.htm#section3">Enumeration Properties</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm#section3">Enumeration Properties</a> <ul /> </li> <li> - <a href="NodeNormalized.htm#section4">Dependency Properties</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm#section4">Dependency Properties</a> <ul> <li> - <a href="NodeNormalized.htm#section5">Inline Definition</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm#section5">Inline Definition</a> </li> <li> - <a href="NodeNormalized.htm#section6">Reference Definition</a> + <a href="http://structuremap.sourceforge.net/NodeNormalized.htm#section6">Reference Definition</a> </li> </ul> </li> </ul> </li> <li> - <a href="AttributeNormalized.htm">Attribute Normalized Instances</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm">Attribute Normalized Instances</a> <ul> <li> - <a href="AttributeNormalized.htm#section0">Instance Root Node</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section0">Instance Root Node</a> <ul /> </li> <li> - <a href="AttributeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section1">Primitive Properties (Strings and basic value types)</a> <ul /> </li> <li> - <a href="AttributeNormalized.htm#section2">Long Strings</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section2">Long Strings</a> <ul /> </li> <li> - <a href="AttributeNormalized.htm#section3">Enumeration Properties</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section3">Enumeration Properties</a> <ul /> </li> <li> - <a href="AttributeNormalized.htm#section4">Dependency Properties</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section4">Dependency Properties</a> <ul> <li> - <a href="AttributeNormalized.htm#section5">Inline Definition</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section5">Inline Definition</a> </li> <li> - <a href="AttributeNormalized.htm#section6">Reference Definition</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section6">Reference Definition</a> </li> </ul> </li> <li> - <a href="AttributeNormalized.htm#section7">Non Primitive Array Property</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section7">Non Primitive Array Property</a> <ul /> </li> <li> - <a href="AttributeNormalized.htm#section8">Primitive Arrays</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section8">Primitive Arrays</a> <ul /> </li> <li> - <a href="AttributeNormalized.htm#section9">Dictionaries and NameValueCollection</a> + <a href="http://structuremap.sourceforge.net/AttributeNormalized.htm#section9">Dictionaries and NameValueCollection</a> <ul /> </li> </ul> </li> <li> - <a href="ScanningAssemblies.htm">Auto Registration and Type Scanning</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm">Auto Registration and Type Scanning</a> <ul> <li> - <a href="ScanningAssemblies.htm#section0">Using the Scan() Expression</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section0">Using the Scan() Expression</a> <ul /> </li> <li> - <a href="ScanningAssemblies.htm#section1">Rules for Auto Registering a Type</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section1">Rules for Auto Registering a Type</a> <ul /> </li> <li> - <a href="ScanningAssemblies.htm#section2">Designating Assemblies </a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section2">Designating Assemblies </a> <ul /> </li> <li> - <a href="ScanningAssemblies.htm#section3">Scan all Assemblies in a Given Folder</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section3">Scan all Assemblies in a Given Folder</a> <ul /> </li> <li> - <a href="ScanningAssemblies.htm#section4">Add All Concrete Types for a PluginType</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section4">Add All Concrete Types for a PluginType</a> <ul /> </li> <li> - <a href="ScanningAssemblies.htm#section5">Excluding or Including Types</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section5">Excluding or Including Types</a> <ul /> </li> <li> - <a href="ScanningAssemblies.htm#section6">Type Scanning with Attributes</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section6">Type Scanning with Attributes</a> <ul /> </li> <li> - <a href="ScanningAssemblies.htm#section7">Convention Based Type Registration</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section7">Convention Based Type Registration</a> <ul> <li> - <a href="ScanningAssemblies.htm#section8">The Default Convention</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section8">The Default Convention</a> </li> <li> - <a href="ScanningAssemblies.htm#section9">Registering Types by Name</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section9">Registering Types by Name</a> </li> <li> - <a href="ScanningAssemblies.htm#section10">Creating and Using Your Own Convention</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section10">Creating and Using Your Own Convention</a> </li> </ul> </li> <li> - <a href="ScanningAssemblies.htm#section11">Looking for Registries</a> + <a href="http://structuremap.sourceforge.net/ScanningAssemblies.htm#section11">Looking for Registries</a> <ul /> </li> </ul> </li> <li> - <a href="Scoping.htm">Scoping, Caching, and Lifecycle Management</a> + <a href="http://structuremap.sourceforge.net/Scoping.htm">Scoping, Caching, and Lifecycle Management</a> <ul> <li> - <a href="Scoping.htm#section0">Setting the Scope in the Registry DSL</a> + <a href="http://structuremap.sourceforge.net/Scoping.htm#section0">Setting the Scope in the Registry DSL</a> <ul /> </li> <li> - <a href="Scoping.htm#section1">Setting the Scope in the Xml Configuration</a> + <a href="http://structuremap.sourceforge.net/Scoping.htm#section1">Setting the Scope in the Xml Configuration</a> <ul /> </li> <li> - <a href="Scoping.htm#section2">Setting the Scope with the PluginFamily Attribute</a> + <a href="http://structuremap.sourceforge.net/Scoping.htm#section2">Setting the Scope with the PluginFamily Attribute</a> <ul /> </li> <li> - <a href="Scoping.htm#section3">Using a Custom Scope/Lifecycle</a> + <a href="http://structuremap.sourceforge.net/Scoping.htm#section3">Using a Custom Scope/Lifecycle</a> <ul /> </li> </ul> </li> <li> - <a href="UsingAttributes.htm">Using Attributes</a> + <a href="http://structuremap.sourceforge.net/UsingAttributes.htm">Using Attributes</a> <ul> <li> - <a href="UsingAttributes.htm#section0">Scanning for Classes marked with Attributes</a> + <a href="http://structuremap.sourceforge.net/UsingAttributes.htm#section0">Scanning for Classes marked with Attributes</a> <ul /> </li> <li> - <a href="UsingAttributes.htm#section1">[DefaultConstructor] Attribute</a> + <a href="http://structuremap.sourceforge.net/UsingAttributes.htm#section1">[DefaultConstructor] Attribute</a> <ul /> </li> <li> - <a href="UsingAttributes.htm#section2">[PluginFamily] Attribute</a> + <a href="http://structuremap.sourceforge.net/UsingAttributes.htm#section2">[PluginFamily] Attribute</a> <ul /> </li> <li> - <a href="UsingAttributes.htm#section3">[Pluggable] Attribute</a> + <a href="http://structuremap.sourceforge.net/UsingAttributes.htm#section3">[Pluggable] Attribute</a> <ul /> </li> <li> - <a href="UsingAttributes.htm#section4">[SetterProperty] Attribute</a> + <a href="http://structuremap.sourceforge.net/UsingAttributes.htm#section4">[SetterProperty] Attribute</a> <ul /> </li> <li> - <a href="UsingAttributes.htm#section5">[ValidationMethod] Attribute</a> + <a href="http://structuremap.sourceforge.net/UsingAttributes.htm#section5">[ValidationMethod] Attribute</a> <ul /> </li> </ul> </li> <li> - <a href="Profiles.htm">Profiles</a> + <a href="http://structuremap.sourceforge.net/Profiles.htm">Profiles</a> <ul /> </li> <li> - <a href="Interception.htm">Interception</a> + <a href="http://structuremap.sourceforge.net/Interception.htm">Interception</a> <ul> <li> - <a href="Interception.htm#section0">Intercept a Single Instance</a> + <a href="http://structuremap.sourceforge.net/Interception.htm#section0">Intercept a Single Instance</a> <ul> <li> - <a href="Interception.htm#section1">Run an Action Against an Object</a> + <a href="http://structuremap.sourceforge.net/Interception.htm#section1">Run an Action Against an Object</a> </li> <li> - <a href="Interception.htm#section2">Wrap or Substitute the Returned Object</a> + <a href="http://structuremap.sourceforge.net/Interception.htm#section2">Wrap or Substitute the Returned Object</a> </li> <li> - <a href="Interception.htm#section3">With a Custom Interceptor</a> + <a href="http://structuremap.sourceforge.net/Interception.htm#section3">With a Custom Interceptor</a> </li> </ul> </li> <li> - <a href="Interception.htm#section4">Apply Interception to all Instances of a PluginType</a> + <a href="http://structuremap.sourceforge.net/Interception.htm#section4">Apply Interception to all Instances of a PluginType</a> <ul /> </li> <li> - <a href="Interception.htm#section5">Apply Interception to all Types Matching a Criteria</a> + <a href="http://structuremap.sourceforge.net/Interception.htm#section5">Apply Interception to all Types Matching a Criteria</a> <ul /> </li> <li> - <a href="Interception.htm#section6">Creating a Custom Type Interceptor</a> + <a href="http://structuremap.sourceforge.net/Interception.htm#section6">Creating a Custom Type Interceptor</a> <ul /> </li> </ul> </li> <li> - <a href="ChangingConfigurationAtRuntime.htm">Changing Configuration at Runtime</a> + <a href="http://structuremap.sourceforge.net/ChangingConfigurationAtRuntime.htm">Changing Configuration at Runtime</a> <ul> <li> - <a href="ChangingConfigurationAtRuntime.htm#section0">Adding Configuration to an Existing Container</a> + <a href="http://structuremap.sourceforge.net/ChangingConfigurationAtRuntime.htm#section0">Adding Configuration to an Existing Container</a> <ul /> </li> <li> - <a href="ChangingConfigurationAtRuntime.htm#section1">Injecting a Single Service at Runtime</a> + <a href="http://structuremap.sourceforge.net/ChangingConfigurationAtRuntime.htm#section1">Injecting a Single Service at Runtime</a> <ul /> </li> <li> - <a href="ChangingConfigurationAtRuntime.htm#section2">Injecting a Mock or a Stub at Runtime</a> + <a href="http://structuremap.sourceforge.net/ChangingConfigurationAtRuntime.htm#section2">Injecting a Mock or a Stub at Runtime</a> <ul /> </li> <li> - <a href="ChangingConfigurationAtRuntime.htm#section3">Ejecting all Instances of a PluginType</a> + <a href="http://structuremap.sourceforge.net/ChangingConfigurationAtRuntime.htm#section3">Ejecting all Instances of a PluginType</a> <ul /> </li> </ul> </li> <li> - <a href="RetrievingServices.htm">Retrieving Services</a> + <a href="http://structuremap.sourceforge.net/RetrievingServices.htm">Retrieving Services</a> <ul> <li> - <a href="RetrievingServices.htm#section0">Get a Service by PluginType</a> + <a href="http://structuremap.sourceforge.net/RetrievingServices.htm#section0">Get a Service by PluginType</a> <ul /> </li> <li> - <a href="RetrievingServices.htm#section1">Get a Service by PluginType and Name</a> + <a href="http://structuremap.sourceforge.net/RetrievingServices.htm#section1">Get a Service by PluginType and Name</a> <ul /> </li> <li> - <a href="RetrievingServices.htm#section2">Get all Instances of a PluginType</a> + <a href="http://structuremap.sourceforge.net/RetrievingServices.htm#section2">Get all Instances of a PluginType</a> <ul /> </li> <li> - <a href="RetrievingServices.htm#section3">"Fill" all of the Dependencies of a Concrete Class</a> + <a href="http://structuremap.sourceforge.net/RetrievingServices.htm#section3">"Fill" all of the Dependencies of a Concrete Class</a> <ul /> </li> <li> - <a href="RetrievingServices.htm#section4">Passing Arguments to StructureMap at Runtime</a> + <a href="http://structuremap.sourceforge.net/RetrievingServices.htm#section4">Passing Arguments to StructureMap at Runtime</a> <ul /> </li> <li> - <a href="RetrievingServices.htm#section5">"Try" to Get an Instance</a> + <a href="http://structuremap.sourceforge.net/RetrievingServices.htm#section5">"Try" to Get an Instance</a> <ul /> </li> </ul> </li> <li> - <a href="AutoMocker.htm">Using the StructureMap AutoMocker</a> + <a href="http://structuremap.sourceforge.net/AutoMocker.htm">Using the StructureMap AutoMocker</a> <ul> <li> - <a href="AutoMocker.htm#section0">How it Works</a> + <a href="http://structuremap.sourceforge.net/AutoMocker.htm#section0">How it Works</a> <ul /> </li> <li> - <a href="AutoMocker.htm#section1">How it uses Mock Engines</a> + <a href="http://structuremap.sourceforge.net/AutoMocker.htm#section1">How it uses Mock Engines</a> <ul /> </li> <li> - <a href="AutoMocker.htm#section2">Supplying Mocks or Stubs to the AutoMocker</a> + <a href="http://structuremap.sourceforge.net/AutoMocker.htm#section2">Supplying Mocks or Stubs to the AutoMocker</a> <ul /> </li> <li> - <a href="AutoMocker.htm#section3">Partial Mock the ClassUnderTest</a> + <a href="http://structuremap.sourceforge.net/AutoMocker.htm#section3">Partial Mock the ClassUnderTest</a> <ul /> </li> </ul> </li> <li> - <a href="Diagnostics.htm">Diagnostics and Environment Tests</a> + <a href="http://structuremap.sourceforge.net/Diagnostics.htm">Diagnostics and Environment Tests</a> <ul> <li> - <a href="Diagnostics.htm#section0">What do I Have?</a> + <a href="http://structuremap.sourceforge.net/Diagnostics.htm#section0">What do I Have?</a> <ul /> </li> <li> - <a href="Diagnostics.htm#section1">Asserting that Configuration is Valid</a> + <a href="http://structuremap.sourceforge.net/Diagnostics.htm#section1">Asserting that Configuration is Valid</a> <ul /> </li> <li> - <a href="Diagnostics.htm#section2">Environment Tests</a> + <a href="http://structuremap.sourceforge.net/Diagnostics.htm#section2">Environment Tests</a> <ul /> </li> <li> - <a href="Diagnostics.htm#section3">StructureMapDoctor</a> + <a href="http://structuremap.sourceforge.net/Diagnostics.htm#section3">StructureMapDoctor</a> <ul /> </li> <li> - <a href="Diagnostics.htm#section4">Querying the Configuration</a> + <a href="http://structuremap.sourceforge.net/Diagnostics.htm#section4">Querying the Configuration</a> <ul /> </li> </ul> </li> <li> - <a href="HowDoesStructureMapWork.htm">How does StructureMap Wo... [truncated message content] |
From: <jer...@us...> - 2009-02-05 15:39:04
|
Revision: 233 http://structuremap.svn.sourceforge.net/structuremap/?rev=233&view=rev Author: jeremydmiller Date: 2009-02-05 15:38:53 +0000 (Thu, 05 Feb 2009) Log Message: ----------- picking up missed files, some extensions to the With() syntax Modified Paths: -------------- trunk/Source/CommonAssemblyInfo.cs trunk/Source/HTML/ScanningAssemblies.htm trunk/Source/StructureMap/Container.cs trunk/Source/StructureMap/ExplicitArgsExpression.cs trunk/Source/StructureMap/IContainer.cs trunk/Source/StructureMap/ObjectFactory.cs trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs trunk/Source/StructureMap/StructureMap.csproj trunk/Source/StructureMap/TypeExtensions.cs trunk/Source/StructureMap.Testing/Graph/TestExplicitArguments.cs trunk/Source/StructureMap.Testing/Pipeline/GenericsHelperExpressionTester.cs trunk/Source/StructureMap.sln trunk/cruise.build Added Paths: ----------- trunk/Source/StructureMap/CloseGenericTypeExpression.cs trunk/Source/StructureMap.Prism/Properties/ trunk/Source/StructureMap.Prism/Properties/AssemblyInfo.cs trunk/Source/StructureMap.Prism/StructureMap.Prism.csproj trunk/Source/StructureMap.Testing.Prism/Properties/ trunk/Source/StructureMap.Testing.Prism/Properties/AssemblyInfo.cs trunk/Source/StructureMap.Testing.Prism/StructureMap.Testing.Prism.csproj trunk/bin/Prism/ trunk/bin/Prism/Prism1/ trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.dll trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.pdb trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.xml trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.dll trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.pdb trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.xml trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.dll trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.pdb trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.xml trunk/bin/Prism/Prism1/Microsoft.Practices.EnterpriseLibrary.Common.dll trunk/bin/Prism/Prism1/Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll trunk/bin/Prism/Prism1/Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll trunk/bin/Prism/Prism1/Microsoft.Practices.EnterpriseLibrary.Logging.dll Modified: trunk/Source/CommonAssemblyInfo.cs =================================================================== --- trunk/Source/CommonAssemblyInfo.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/CommonAssemblyInfo.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -13,11 +13,11 @@ //------------------------------------------------------------------------------ [assembly: ComVisibleAttribute(false)] -[assembly: AssemblyVersionAttribute("2.5.3.0000")] +[assembly: AssemblyVersionAttribute("2.5.4.0000")] [assembly: AssemblyCopyrightAttribute("Copyright (c) 2003-2008, Jeremy D. Miller")] [assembly: AssemblyProductAttribute("StructureMap")] [assembly: AssemblyCompanyAttribute("")] [assembly: AssemblyConfigurationAttribute("release")] -[assembly: AssemblyInformationalVersionAttribute("2.5.3.0000")] -[assembly: AssemblyFileVersionAttribute("2.5.3.0000")] +[assembly: AssemblyInformationalVersionAttribute("2.5.4.0000")] +[assembly: AssemblyFileVersionAttribute("2.5.4.0000")] Modified: trunk/Source/HTML/ScanningAssemblies.htm =================================================================== --- trunk/Source/HTML/ScanningAssemblies.htm 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/HTML/ScanningAssemblies.htm 2009-02-05 15:38:53 UTC (rev 233) @@ -1148,7 +1148,7 @@ <p style="margin: 0px;"> }</p> <p style="margin: 0px;"> -& }</p> + }</p> </div> <!--EndFragment--> <p>You apply the custom ITypeScanner by simply calling With() inside of a Scan() Added: trunk/Source/StructureMap/CloseGenericTypeExpression.cs =================================================================== --- trunk/Source/StructureMap/CloseGenericTypeExpression.cs (rev 0) +++ trunk/Source/StructureMap/CloseGenericTypeExpression.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -0,0 +1,48 @@ +using System; + +namespace StructureMap +{ + public interface OpenGenericTypeSpecificationExpression + { + T As<T>(); + } + + public class CloseGenericTypeExpression : OpenGenericTypeSpecificationExpression + { + private readonly object _subject; + private readonly IContainer _container; + private Type _pluginType; + + public CloseGenericTypeExpression(object subject, IContainer container) + { + _subject = subject; + _container = container; + } + + /// <summary> + /// Specify the open generic type that should have a single generic parameter + /// </summary> + /// <param name="type"></param> + /// <returns></returns> + public OpenGenericTypeSpecificationExpression GetClosedTypeOf(Type type) + { + if (!type.IsGeneric()) + { + throw new StructureMapException(285); + } + + _pluginType = type.MakeGenericType(_subject.GetType()); + return this; + } + + /// <summary> + /// specify what type you'd like the service returned as + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns></returns> + T OpenGenericTypeSpecificationExpression.As<T>() + { + return (T) _container.With(_subject.GetType(), _subject).GetInstance(_pluginType); + } + } +} \ No newline at end of file Modified: trunk/Source/StructureMap/Container.cs =================================================================== --- trunk/Source/StructureMap/Container.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap/Container.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -411,6 +411,18 @@ } /// <summary> + /// Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency + /// of type T should be "arg" + /// </summary> + /// <param name="pluginType"></param> + /// <param name="arg"></param> + /// <returns></returns> + public ExplicitArgsExpression With(Type pluginType, object arg) + { + return new ExplicitArgsExpression(this).With(pluginType, arg); + } + + /// <summary> /// 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. /// </summary> @@ -549,5 +561,23 @@ { T GetInstanceAs<T>(); } + + /// <summary> + /// Shortcut syntax for using an object to find a service that handles + /// that type of object by using an open generic type + /// </summary> + /// <example> + /// IHandler handler = container.ForObject(shipment) + /// .GetClosedTypeOf(typeof (IHandler<>)) + /// .As<IHandler>(); + /// </example> + /// <param name="subject"></param> + /// <returns></returns> + public CloseGenericTypeExpression ForObject(object subject) + { + return new CloseGenericTypeExpression(subject, this); + } } + + } \ No newline at end of file Modified: trunk/Source/StructureMap/ExplicitArgsExpression.cs =================================================================== --- trunk/Source/StructureMap/ExplicitArgsExpression.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap/ExplicitArgsExpression.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -49,6 +49,18 @@ } /// <summary> + /// Pass in additional arguments by type + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="arg"></param> + /// <returns></returns> + public ExplicitArgsExpression With(Type pluginType, object arg) + { + _args.Set(pluginType, arg); + return this; + } + + /// <summary> /// Pass in additional arguments by name /// </summary> /// <param name="argName"></param> Modified: trunk/Source/StructureMap/IContainer.cs =================================================================== --- trunk/Source/StructureMap/IContainer.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap/IContainer.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -246,5 +246,27 @@ /// <param name="name"></param> /// <returns></returns> T GetInstance<T>(ExplicitArguments args, string name); + + /// <summary> + /// Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency + /// of type T should be "arg" + /// </summary> + /// <param name="pluginType"></param> + /// <param name="arg"></param> + /// <returns></returns> + ExplicitArgsExpression With(Type pluginType, object arg); + + /// <summary> + /// Shortcut syntax for using an object to find a service that handles + /// that type of object by using an open generic type + /// </summary> + /// <example> + /// IHandler handler = container.ForObject(shipment) + /// .GetClosedTypeOf(typeof (IHandler<>)) + /// .As<IHandler>(); + /// </example> + /// <param name="subject"></param> + /// <returns></returns> + CloseGenericTypeExpression ForObject(object subject); } } \ No newline at end of file Modified: trunk/Source/StructureMap/ObjectFactory.cs =================================================================== --- trunk/Source/StructureMap/ObjectFactory.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap/ObjectFactory.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -257,6 +257,18 @@ } /// <summary> + /// Starts a request for an instance or instances with explicitly configured arguments. Specifies that any dependency + /// of type T should be "arg" + /// </summary> + /// <param name="pluginType"></param> + /// <param name="arg"></param> + /// <returns></returns> + public static ExplicitArgsExpression With(Type pluginType, object arg) + { + return container.With(pluginType, arg); + } + + /// <summary> /// Removes all configured instances of type T from the Container. Use with caution! /// </summary> /// <typeparam name="T"></typeparam> @@ -438,5 +450,22 @@ return container.ForGenericType(templateType); } + + /// <summary> + /// Shortcut syntax for using an object to find a service that handles + /// that type of object by using an open generic type + /// </summary> + /// <example> + /// IHandler handler = container.ForObject(shipment) + /// .GetClosedTypeOf(typeof (IHandler<>)) + /// .As<IHandler>(); + /// </example> + /// <param name="subject"></param> + /// <returns></returns> + public static CloseGenericTypeExpression ForObject(object subject) + { + return container.ForObject(subject); + } + } } \ No newline at end of file Modified: trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs =================================================================== --- trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap/Pipeline/ExplicitArguments.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -29,9 +29,14 @@ public void Set<T>(T arg) { - _children.Add(typeof (T), arg); + Set(typeof (T), arg); } + public void Set(Type pluginType, object arg) + { + _children.Add(pluginType, arg); + } + public void SetArg(string key, object argValue) { _args.Add(key, argValue); Modified: trunk/Source/StructureMap/StructureMap.csproj =================================================================== --- trunk/Source/StructureMap/StructureMap.csproj 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap/StructureMap.csproj 2009-02-05 15:38:53 UTC (rev 233) @@ -56,7 +56,7 @@ <DebugSymbols>true</DebugSymbols> <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> - <NoWarn>618,1591</NoWarn> + <NoWarn>618,1591,1573,1711,1570</NoWarn> <Optimize>false</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> @@ -77,7 +77,7 @@ <DebugSymbols>true</DebugSymbols> <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> - <NoWarn>618,1591</NoWarn> + <NoWarn>618,1591,1573,1711,1570</NoWarn> <Optimize>true</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> @@ -381,6 +381,7 @@ <Link>Properties\structuremap.snk</Link> </None> <None Include="ConfigurationClasses.cd" /> + <Compile Include="CloseGenericTypeExpression.cs" /> <Compile Include="ConfigurationExpression.cs" /> <Compile Include="Configuration\DictionaryReader.cs" /> <Compile Include="Configuration\DSL\Expressions\InstanceExpression.cs" /> Modified: trunk/Source/StructureMap/TypeExtensions.cs =================================================================== --- trunk/Source/StructureMap/TypeExtensions.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap/TypeExtensions.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -69,7 +69,7 @@ } } - return null; + return pluggedType.BaseType == typeof(object) ? null : pluggedType.BaseType.FindInterfaceThatCloses(templateType); } public static string GetName(this Type type) Added: trunk/Source/StructureMap.Prism/Properties/AssemblyInfo.cs =================================================================== --- trunk/Source/StructureMap.Prism/Properties/AssemblyInfo.cs (rev 0) +++ trunk/Source/StructureMap.Prism/Properties/AssemblyInfo.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("StructureMap.Prism")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("StructureMap.Prism")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2b71f182-5fdb-4df8-913e-76c95445fd1f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/Source/StructureMap.Prism/StructureMap.Prism.csproj =================================================================== --- trunk/Source/StructureMap.Prism/StructureMap.Prism.csproj (rev 0) +++ trunk/Source/StructureMap.Prism/StructureMap.Prism.csproj 2009-02-05 15:38:53 UTC (rev 233) @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{150CACB1-7F59-4C68-8830-F277E0E98A3F}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>StructureMap.Prism</RootNamespace> + <AssemblyName>StructureMap.Prism</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <SignAssembly>false</SignAssembly> + <AssemblyOriginatorKeyFile>structuremap.snk</AssemblyOriginatorKeyFile> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Practices.Composite, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\bin\Prism\Prism1\Microsoft.Practices.Composite.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Practices.Composite.Wpf, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\bin\Prism\Prism1\Microsoft.Practices.Composite.Wpf.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data.DataSetExtensions"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="DefaultRegistry.cs" /> + <Compile Include="PrismBootstrapper.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="StructureMapContainerFacade.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="structuremap.snk" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\StructureMap\StructureMap.csproj"> + <Project>{3F36EA80-2F9A-4DAD-BA27-5AC6163A2EE3}</Project> + <Name>StructureMap</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Modified: trunk/Source/StructureMap.Testing/Graph/TestExplicitArguments.cs =================================================================== --- trunk/Source/StructureMap.Testing/Graph/TestExplicitArguments.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap.Testing/Graph/TestExplicitArguments.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -179,6 +179,53 @@ } [Test] + public void Fill_in_argument_by_type() + { + var container = new Container(x => + { + x.ForRequestedType<IView>().TheDefaultIsConcreteType<View>(); + }); + + var theNode = new SpecialNode(); + var theTrade = new Trade(); + + var command = container + .With(typeof(Node), theNode) + .With(theTrade) + .GetInstance<Command>(); + + Assert.IsInstanceOfType(typeof(View), command.View); + Assert.AreSame(theNode, command.Node); + Assert.AreSame(theTrade, command.Trade); + } + + [Test] + public void Fill_in_argument_by_type_with_ObjectFactory() + { + ObjectFactory.Initialize(x => + { + x.ForRequestedType<IView>().TheDefaultIsConcreteType<View>(); + }); + + var theNode = new SpecialNode(); + var theTrade = new Trade(); + + var command = ObjectFactory + .With(typeof(Node), theNode) + .With(theTrade) + .GetInstance<Command>(); + + Assert.IsInstanceOfType(typeof(View), command.View); + Assert.AreSame(theNode, command.Node); + Assert.AreSame(theTrade, command.Trade); + } + + public class SpecialNode : Node + { + + } + + [Test] public void NowDoItWithObjectFactoryItself() { ObjectFactory.Initialize(x => Modified: trunk/Source/StructureMap.Testing/Pipeline/GenericsHelperExpressionTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Pipeline/GenericsHelperExpressionTester.cs 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap.Testing/Pipeline/GenericsHelperExpressionTester.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -140,4 +140,75 @@ return null; } } + + + [TestFixture] + public class when_getting_a_closed_type_from_an_open_generic_type_by_providing_an_input_parameter + { + [Test] + public void fetch_the_object() + { + var container = new Container(x => + { + x.ForRequestedType<IHandler<Shipment>>().TheDefaultIsConcreteType<ShipmentHandler>(); + }); + + var shipment = new Shipment(); + + IHandler handler = container + .ForObject(shipment) + .GetClosedTypeOf(typeof (IHandler<>)) + .As<IHandler>(); + + handler.ShouldBeOfType<ShipmentHandler>().Shipment.ShouldBeTheSameAs(shipment); + } + } + + [TestFixture] + public class when_getting_a_closed_type_from_an_open_generic_type_by_providing_an_input_parameter_from_ObjectFactory + { + [Test] + public void fetch_the_object() + { + ObjectFactory.Initialize(x => + { + x.ForRequestedType<IHandler<Shipment>>().TheDefaultIsConcreteType<ShipmentHandler>(); + }); + + var shipment = new Shipment(); + IHandler handler = ObjectFactory.ForObject(shipment).GetClosedTypeOf(typeof(IHandler<>)).As<IHandler>(); + + handler.ShouldBeOfType<ShipmentHandler>().Shipment.ShouldBeTheSameAs(shipment); + } + } + + public class Shipment + { + + } + + public interface IHandler<T> : IHandler + { + + } + + public interface IHandler + { + + } + + public class ShipmentHandler : IHandler<Shipment> + { + private readonly Shipment _shipment; + + public ShipmentHandler(Shipment shipment) + { + _shipment = shipment; + } + + public Shipment Shipment + { + get { return _shipment; } + } + } } \ No newline at end of file Added: trunk/Source/StructureMap.Testing.Prism/Properties/AssemblyInfo.cs =================================================================== --- trunk/Source/StructureMap.Testing.Prism/Properties/AssemblyInfo.cs (rev 0) +++ trunk/Source/StructureMap.Testing.Prism/Properties/AssemblyInfo.cs 2009-02-05 15:38:53 UTC (rev 233) @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("StructureMap.Testing.Prism")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("StructureMap.Testing.Prism")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f0176eaa-10fe-453d-abe0-2fb3df709cde")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/Source/StructureMap.Testing.Prism/StructureMap.Testing.Prism.csproj =================================================================== --- trunk/Source/StructureMap.Testing.Prism/StructureMap.Testing.Prism.csproj (rev 0) +++ trunk/Source/StructureMap.Testing.Prism/StructureMap.Testing.Prism.csproj 2009-02-05 15:38:53 UTC (rev 233) @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7F72EFA9-B575-462A-855F-132F8DBC6E9D}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>StructureMap.Testing.Prism</RootNamespace> + <AssemblyName>StructureMap.Testing.Prism</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Practices.Composite, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\bin\Prism\Prism1\Microsoft.Practices.Composite.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Practices.Composite.Wpf, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\bin\Prism\Prism1\Microsoft.Practices.Composite.Wpf.dll</HintPath> + </Reference> + <Reference Include="nunit.framework, Version=2.4.0.2, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\bin\NUnit\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data.DataSetExtensions"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="DefaultRegistryTester.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="StructureMapContainerFacadeTester.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\StructureMap.Prism\StructureMap.Prism.csproj"> + <Project>{150CACB1-7F59-4C68-8830-F277E0E98A3F}</Project> + <Name>StructureMap.Prism</Name> + </ProjectReference> + <ProjectReference Include="..\StructureMap.Testing\StructureMap.Testing.csproj"> + <Project>{63C2742D-B6E2-484F-AFDB-346873075C5E}</Project> + <Name>StructureMap.Testing</Name> + </ProjectReference> + <ProjectReference Include="..\StructureMap\StructureMap.csproj"> + <Project>{3F36EA80-2F9A-4DAD-BA27-5AC6163A2EE3}</Project> + <Name>StructureMap</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Modified: trunk/Source/StructureMap.sln =================================================================== --- trunk/Source/StructureMap.sln 2009-02-01 20:03:18 UTC (rev 232) +++ trunk/Source/StructureMap.sln 2009-02-05 15:38:53 UTC (rev 233) @@ -57,10 +57,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TableOfContentsBuilder", "TableOfContentsBuilder\TableOfContentsBuilder.csproj", "{8A9EAE91-F3F5-4919-86FC-6D98D00FC77F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureMap.Prism", "StructureMap.Prism\StructureMap.Prism.csproj", "{150CACB1-7F59-4C68-8830-F277E0E98A3F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructureMap.Testing.Prism", "StructureMap.Testing.Prism\StructureMap.Testing.Prism.csproj", "{7F72EFA9-B575-462A-855F-132F8DBC6E9D}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Build|.NET = Build|.NET @@ -296,36 +292,6 @@ {8A9EAE91-F3F5-4919-86FC-6D98D00FC77F}.Release|Any CPU.Build.0 = Release|Any CPU {8A9EAE91-F3F5-4919-86FC-6D98D00FC77F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {8A9EAE91-F3F5-4919-86FC-6D98D00FC77F}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Build|.NET.ActiveCfg = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Build|Any CPU.ActiveCfg = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Build|Any CPU.Build.0 = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Build|Mixed Platforms.ActiveCfg = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Build|Mixed Platforms.Build.0 = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Debug|.NET.ActiveCfg = Debug|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Release|.NET.ActiveCfg = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Release|Any CPU.Build.0 = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {150CACB1-7F59-4C68-8830-F277E0E98A3F}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Build|.NET.ActiveCfg = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Build|Any CPU.ActiveCfg = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Build|Any CPU.Build.0 = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Build|Mixed Platforms.ActiveCfg = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Build|Mixed Platforms.Build.0 = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Debug|.NET.ActiveCfg = Debug|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Release|.NET.ActiveCfg = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Release|Any CPU.Build.0 = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {7F72EFA9-B575-462A-855F-132F8DBC6E9D}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Added: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.dll =================================================================== (Binary files differ) Property changes on: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.pdb =================================================================== (Binary files differ) Property changes on: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.pdb ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.xml =================================================================== --- trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.xml (rev 0) +++ trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.UnityExtensions.xml 2009-02-05 15:38:53 UTC (rev 233) @@ -0,0 +1,230 @@ +<?xml version="1.0"?> +<doc> + <assembly> + <name>Microsoft.Practices.Composite.UnityExtensions</name> + </assembly> + <members> + <member name="T:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources"> + <summary> + A strongly-typed resource class, for looking up localized strings, etc. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.ResourceManager"> + <summary> + Returns the cached ResourceManager instance used by this class. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.Culture"> + <summary> + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.NotOverwrittenGetModuleEnumeratorException"> + <summary> + Looks up a localized string similar to The method 'GetModuleEnumerator' of the bootstrapper must be overwritten in order to use the default module initialization logic.. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.NullLoggerFacadeException"> + <summary> + Looks up a localized string similar to The ILoggerFacade is required and cannot be null.. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.NullModuleEnumeratorException"> + <summary> + Looks up a localized string similar to The IModuleEnumerator is required and cannot be null in order to initialize the modules.. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.NullModuleLoaderException"> + <summary> + Looks up a localized string similar to The IModuleLoader is required and cannot be null in order to initialize the modules.. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.NullUnityContainerException"> + <summary> + Looks up a localized string similar to The IUnityContainer is required and cannot be null.. + </summary> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.Properties.Resources.TypeMappingAlreadyRegistered"> + <summary> + Looks up a localized string similar to Type '{0}' was already registered by the application. Skipping.... + </summary> + </member> + <member name="T:Microsoft.Practices.Composite.UnityExtensions.UnityContainerHelper"> + <summary> + Extensions methods to extend and facilitate the usage of <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/>. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerHelper.IsTypeRegistered(Microsoft.Practices.Unity.IUnityContainer,System.Type)"> + <summary> + Returns whether a specified type has a type mapping registered in the container. + </summary> + <param name="container">The <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/> to check for the type mapping.</param> + <param name="type">The type to check if there is a type mapping for.</param> + <returns><see langword="true"/> if there is a type mapping registered for <paramref name="type"/>.</returns> + <remarks>In order to use this extension method, you first need to add the + <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/> extension to the <see cref="T:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapperExtension"/>. + </remarks> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerHelper.TryResolve``1(Microsoft.Practices.Unity.IUnityContainer)"> + <summary> + Utility method to try to resolve a service from the container avoiding an exception if the container cannot build the type. + </summary> + <param name="container">The cointainer that will be used to resolve the type.</param> + <typeparam name="T">The type to resolve.</typeparam> + <returns>The instance of <typeparamref name="T"/> built up by the container.</returns> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerHelper.TryResolve(Microsoft.Practices.Unity.IUnityContainer,System.Type)"> + <summary> + Utility method to try to resolve a service from the container avoiding an exception if the container cannot build the type. + </summary> + <param name="container">The cointainer that will be used to resolve the type.</param> + <param name="typeToResolve">The type to resolve.</param> + <returns>The instance of <paramref name="typeToResolve"/> built up by the container.</returns> + </member> + <member name="T:Microsoft.Practices.Composite.UnityExtensions.UnityContainerAdapter"> + <summary> + Defines a <seealso cref="T:Microsoft.Practices.Unity.IUnityContainer"/> adapter for + the <see cref="T:Microsoft.Practices.Composite.IContainerFacade"/> interface + to be used by the Composite Application Library. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerAdapter.#ctor(Microsoft.Practices.Unity.IUnityContainer)"> + <summary> + Initializes a new instance of <see cref="T:Microsoft.Practices.Composite.UnityExtensions.UnityContainerAdapter"/>. + </summary> + <param name="unityContainer">The <seealso cref="T:Microsoft.Practices.Unity.IUnityContainer"/> that will be used + by the <see cref="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerAdapter.Resolve(System.Type)"/> and <see cref="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerAdapter.TryResolve(System.Type)"/> methods.</param> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerAdapter.Resolve(System.Type)"> + <summary> + Resolve an instance of the requested type from the container. + </summary> + <param name="type">The type of object to get from the container.</param> + <returns>An instance of <paramref name="type"/>.</returns> + <exception cref="T:Microsoft.Practices.Unity.ResolutionFailedException"><paramref name="type"/> cannot be resolved by the container.</exception> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityContainerAdapter.TryResolve(System.Type)"> + <summary> + Tries to resolve an instance of the requested type from the container. + </summary> + <param name="type">The type of object to get from the container.</param> + <returns> + An instance of <paramref name="type"/>. + If the type cannot be resolved it will return a <see langword="null"/> value. + </returns> + </member> + <member name="T:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper"> + <summary> + Base class that provides a basic bootstrapping sequence that + registers most of the Composite Application Library assets + in a <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/>. + </summary> + <remarks> + This class must be overriden to provide application specific configuration. + </remarks> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.Run"> + <summary> + Runs the bootstrapper process. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.Run(System.Boolean)"> + <summary> + Run the bootstrapper process. + </summary> + <param name="useDefaultConfiguration">If <see langword="true"/>, registers default Composite Application Library services in the container. This is the default behavior.</param> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.ConfigureContainer"> + <summary> + Configures the <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/>. May be overwritten in a derived class to add specific + type mappings required by the application. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.ConfigureRegionAdapterMappings"> + <summary> + Configures the default region adapter mappings to use in the application, in order + to adapt UI controls defined in XAML to use a region and register it automatically. + May be overwritten in a derived class to add specific mappings required by the application. + </summary> + <returns>The <see cref="T:Microsoft.Practices.Composite.Wpf.Regions.RegionAdapterMappings"/> instance containing all the mappings.</returns> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.InitializeModules"> + <summary> + Initializes the modules. May be overwritten in a derived class to use custom + module loading and avoid using an <seealso cref="T:Microsoft.Practices.Composite.Modularity.IModuleLoader"/> and + <seealso cref="T:Microsoft.Practices.Composite.Modularity.IModuleEnumerator"/>. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.CreateContainer"> + <summary> + Creates the <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/> that will be used as the default container. + </summary> + <returns>A new instance of <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/>.</returns> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.GetModuleEnumerator"> + <summary> + Returns the module enumerator that will be used to initialize the modules. + </summary> + <remarks> + When using the default initialization behavior, this method must be overwritten by a derived class. + </remarks> + <returns>An instance of <see cref="T:Microsoft.Practices.Composite.Modularity.IModuleEnumerator"/> that will be used to initialize the modules.</returns> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.RegisterTypeIfMissing(System.Type,System.Type,System.Boolean)"> + <summary> + Registers a type in the container only if that type was not already registered. + </summary> + <param name="fromType">The interface type to register.</param> + <param name="toType">The type implementing the interface.</param> + <param name="registerAsSingleton">Registers the type as a singleton.</param> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.CreateShell"> + <summary> + Creates the shell or main window of the application. + </summary> + <returns>The shell of the application.</returns> + <remarks> + If the returned instance is a <see cref="T:System.Windows.DependencyObject"/>, the + <see cref="T:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper"/> will attach the default <seealso cref="T:Microsoft.Practices.Composite.Regions.IRegionManager"/> of + the application in its <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionManagerProperty"/> attached property + in order to be able to add regions by using the <seealso cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionNameProperty"/> + attached property from XAML. + </remarks> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.Container"> + <summary> + Gets the default <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/> for the application. + </summary> + <value>The default <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/> instance.</value> + </member> + <member name="P:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapper.LoggerFacade"> + <summary> + Gets the default <see cref="T:Microsoft.Practices.Composite.Logging.ILoggerFacade"/> for the application. + </summary> + <value>A <see cref="T:Microsoft.Practices.Composite.Logging.ILoggerFacade"/> instance.</value> + </member> + <member name="T:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapperExtension"> + <summary> + Implements a <see cref="T:Microsoft.Practices.Unity.UnityContainerExtension"/> that checks if a specific type was registered with the container. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapperExtension.IsTypeRegistered(Microsoft.Practices.Unity.IUnityContainer,System.Type)"> + <summary> + Evaluates if a specified type was registered in the container. + </summary> + <param name="container">The container to check if the type was registered in.</param> + <param name="type">The type to check if it was registered.</param> + <returns><see langword="true"/> if the <paramref name="type"/> was registered with the container.</returns> + <remarks> + In order to use this extension, you must first call <see cref="M:Microsoft.Practices.Unity.IUnityContainer.AddNewExtension``1"/> + and specify <see cref="T:Microsoft.Practices.Unity.UnityContainerExtension"/> as the extension type. + </remarks> + </member> + <member name="M:Microsoft.Practices.Composite.UnityExtensions.UnityBootstrapperExtension.Initialize"> + <summary> + Initializes the container with this extension's functionality. + </summary> + </member> + </members> +</doc> Added: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.dll =================================================================== (Binary files differ) Property changes on: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.pdb =================================================================== (Binary files differ) Property changes on: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.pdb ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.xml =================================================================== --- trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.xml (rev 0) +++ trunk/bin/Prism/Prism1/Microsoft.Practices.Composite.Wpf.xml 2009-02-05 15:38:53 UTC (rev 233) @@ -0,0 +1,881 @@ +<?xml version="1.0"?> +<doc> + <assembly> + <name>Microsoft.Practices.Composite.Wpf</name> + </assembly> + <members> + <member name="T:Microsoft.Practices.Composite.Wpf.Regions.RegionManager"> + <summary> + This class is responsible for maintaining a collection of regions and attaching regions to controls. + </summary> + <remarks> + This class supplies the attached properties that can be used for simple region creation from XAML. + It finds an adapter mapped to a WPF control and associates a new region to that control by calling + <see cref="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.AttachNewRegion(System.Object,System.String)"/> automatically. + </remarks> + </member> + <member name="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionNameProperty"> + <summary> + Identifies the RegionName attached property. + </summary> + <remarks> + When a control has both the <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionNameProperty"/> and + <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionManagerProperty"/> attached properties set to + a value different than <see langword="null"/> and there is a + <see cref="T:Microsoft.Practices.Composite.Regions.IRegionAdapter"/> mapping registered for the control, it + will create and adapt a new region for that control, and register it + in the <see cref="T:Microsoft.Practices.Composite.Regions.IRegionManager"/> with the specified region name. + </remarks> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.SetRegionName(System.Windows.DependencyObject,System.String)"> + <summary> + Sets the <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionNameProperty"/> attached property. + </summary> + <param name="regionTarget">The object to adapt. This is typically a container (i.e a control).</param> + <param name="regionName">The name of the region to register.</param> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.GetRegionName(System.Windows.DependencyObject)"> + <summary> + Gets the value for the <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionNameProperty"/> attached property. + </summary> + <param name="regionTarget">The object to adapt. This is typically a container (i.e a control).</param> + <returns>The name of the region that should be created when + <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionManagerProperty"/> is also set in this element.</returns> + </member> + <member name="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionManagerProperty"> + <summary> + Identifies the RegionManager attached property. + </summary> + <remarks> + When a control has both the <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionNameProperty"/> and + <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionManagerProperty"/> attached properties set to + a value different than <see langword="null"/> and there is a + <see cref="T:Microsoft.Practices.Composite.Regions.IRegionAdapter"/> mapping registered for the control, it + will create and adapt a new region for that control, and register it + in the <see cref="T:Microsoft.Practices.Composite.Regions.IRegionManager"/> with the specified region name. + </remarks> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.GetRegionManager(System.Windows.DependencyObject)"> + <summary> + Gets the value of the <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionNameProperty"/> attached property. + </summary> + <param name="target">The target element.</param> + <returns>The <see cref="T:Microsoft.Practices.Composite.Regions.IRegionManager"/> attached to the <paramref name="target"/> element.</returns> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.SetRegionManager(System.Windows.DependencyObject,Microsoft.Practices.Composite.Regions.IRegionManager)"> + <summary> + Sets the <see cref="F:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.RegionManagerProperty"/> attached property. + </summary> + <param name="target">The target element.</param> + <param name="value">The value.</param> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.#ctor"> + <summary> + Initializes a new instance of <see cref="T:Microsoft.Practices.Composite.Wpf.Regions.RegionManager"/>. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.#ctor(Microsoft.Practices.Composite.Wpf.Regions.RegionAdapterMappings)"> + <summary> + Initializes a new instance of <see cref="T:Microsoft.Practices.Composite.Wpf.Regions.RegionManager"/>. + </summary> + <param name="mappings">The <see cref="T:Microsoft.Practices.Composite.Wpf.Regions.RegionAdapterMappings"/> that + will be used when calling <see cref="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.AttachNewRegion(System.Object,System.String)"/> explicitly + or by creating regions by using attached properties through XAML. + </param> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.AttachNewRegion(System.Object,System.String)"> + <summary> + Attaches a region to an object and adds it to the region manager. + </summary> + <param name="regionTarget">The object to adapt. This is typically a container (i.e a control).</param> + <param name="regionName">The name of the region to register.</param> + <exception cref="T:System.ArgumentException">When regions collection already has a region registered using <paramref name="regionName"/>.</exception> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.CreateRegionManager"> + <summary> + Creates a new region manager. + </summary> + <returns>A new region manager that can be used as a different scope from the current region manager.</returns> + </member> + <member name="P:Microsoft.Practices.Composite.Wpf.Regions.RegionManager.Regions"> + <summary> + Gets a dictionary of <see cref="T:Microsoft.Practices.Composite.Regions.IRegion"/> that identify each region by name. + You can use this dictionary to add or remove regions to the current region manager. + </summary> + <value>An <see cref="T:System.Collections.Generic.IDictionary`2"/> with all the registered regions.</value> + </member> + <member name="T:Microsoft.Practices.Composite.Wpf.Regions.RegionAdapterMappings"> + <summary> + This class maps <see cref="T:System.Type"/> with <see cref="T:Microsoft.Practices.Composite.Regions.IRegionAdapter"/>. + </summary> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionAdapterMappings.RegisterMapping(System.Type,Microsoft.Practices.Composite.Regions.IRegionAdapter)"> + <summary> + Registers the mapping between a type and an adapter. + </summary> + <param name="controlType">The type of the control.</param> + <param name="adapter">The adapter to use with the <paramref name="controlType"/> type.</param> + <exception cref="T:System.ArgumentNullException">When any of <paramref name="controlType"/> or <paramref name="adapter"/> are <see langword="null"/>.</exception> + <exception cref="T:System.InvalidOperationException">If a mapping for <paramref name="controlType"/> already exists.</exception> + </member> + <member name="M:Microsoft.Practices.Composite.Wpf.Regions.RegionAdapterMappings.... [truncated message content] |
From: <fli...@us...> - 2009-06-03 02:23:08
|
Revision: 242 http://structuremap.svn.sourceforge.net/structuremap/?rev=242&view=rev Author: flimflan Date: 2009-06-03 02:16:54 +0000 (Wed, 03 Jun 2009) Log Message: ----------- Tightening up TeamCity integration in the build Modified Paths: -------------- trunk/cruise.build Added Paths: ----------- trunk/bin/nant/extensions/common/2.0/License-BlueWireTechnologies.txt trunk/bin/nant/extensions/common/2.0/License-Castle.txt trunk/bin/nant/extensions/common/2.0/License-NAntExtensions.TeamCity.txt trunk/bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.dll trunk/bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.pdb Removed Paths: ------------- trunk/Source/CommonAssemblyInfo.cs Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - build results push.bat deploy TestResult.xml + build results push.bat deploy TestResult.xml archive Deleted: trunk/Source/CommonAssemblyInfo.cs =================================================================== --- trunk/Source/CommonAssemblyInfo.cs 2009-05-18 21:40:09 UTC (rev 241) +++ trunk/Source/CommonAssemblyInfo.cs 2009-06-03 02:16:54 UTC (rev 242) @@ -1,23 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -//------------------------------------------------------------------------------ -// <auto-generated> -// This code was generated by a tool. -// Runtime Version:2.0.50727.3053 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// </auto-generated> -//------------------------------------------------------------------------------ - -[assembly: ComVisibleAttribute(false)] -[assembly: AssemblyVersionAttribute("2.5.4.0000")] -[assembly: AssemblyCopyrightAttribute("Copyright (c) 2003-2008, Jeremy D. Miller")] -[assembly: AssemblyProductAttribute("StructureMap")] -[assembly: AssemblyCompanyAttribute("")] -[assembly: AssemblyConfigurationAttribute("release")] -[assembly: AssemblyInformationalVersionAttribute("2.5.4.0000")] -[assembly: AssemblyFileVersionAttribute("2.5.4.0000")] - Added: trunk/bin/nant/extensions/common/2.0/License-BlueWireTechnologies.txt =================================================================== --- trunk/bin/nant/extensions/common/2.0/License-BlueWireTechnologies.txt (rev 0) +++ trunk/bin/nant/extensions/common/2.0/License-BlueWireTechnologies.txt 2009-06-03 02:16:54 UTC (rev 242) @@ -0,0 +1,15 @@ +Copyright (c) 2008, Bluewire Technologies Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the Bluewire Technologies Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file Added: trunk/bin/nant/extensions/common/2.0/License-Castle.txt =================================================================== --- trunk/bin/nant/extensions/common/2.0/License-Castle.txt (rev 0) +++ trunk/bin/nant/extensions/common/2.0/License-Castle.txt 2009-06-03 02:16:54 UTC (rev 242) @@ -0,0 +1,57 @@ +Apache License, Version 2.0 + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + + 2. You must cause any modified files to carry prominent notices stating that You changed the files; and + + 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS Added: trunk/bin/nant/extensions/common/2.0/License-NAntExtensions.TeamCity.txt =================================================================== --- trunk/bin/nant/extensions/common/2.0/License-NAntExtensions.TeamCity.txt (rev 0) +++ trunk/bin/nant/extensions/common/2.0/License-NAntExtensions.TeamCity.txt 2009-06-03 02:16:54 UTC (rev 242) @@ -0,0 +1,15 @@ +Copyright (c) 2008, Alexander Gro\xDF and Marnix van Valen +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the Alexander Gro\xDF and Marnix van Valen nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file Added: trunk/bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.dll =================================================================== (Binary files differ) Property changes on: trunk/bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.pdb =================================================================== (Binary files differ) Property changes on: trunk/bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.pdb ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2009-05-18 21:40:09 UTC (rev 241) +++ trunk/cruise.build 2009-06-03 02:16:54 UTC (rev 242) @@ -1,96 +1,98 @@ <project name="StructureMap" default="all"> - <property name="build.dir" value="build" /> - <property name="deployment.dir" value="source\StructureMap.Testing.DeploymentTasks\"/> - <property name="results.dir" value="results" /> - <property name="nant.dir" value="bin\nant" /> - <property name="project.version" value="2.5.4" /> - <property name="project.config" value="release" /> - <property name="archive.dir" value="d:\builds\StructureMap"/> + <property name="build.dir" value="build" /> + <property name="deployment.dir" value="source\StructureMap.Testing.DeploymentTasks\"/> + <property name="results.dir" value="results" /> + <property name="nant.dir" value="bin\nant" /> + <property name="project.version" value="2.5.4" /> + <property name="project.config" value="release" /> + <property name="archive.dir" value="archive"/> + <property name="cibuild" value="false" /> + <property name="cibuild" value="true" if="${environment::variable-exists('TEAMCITY_PROJECT_NAME')}" /> + <target name="all" depends="compile, unit-test, post-clean"/> + <target name="cruise" depends="compile, unit-test, post-clean, archive" /> - <target name="all" depends="compile, unit-test, post-clean"/> - <target name="cruise" depends="compile, unit-test, post-clean, archive" /> + <target name="pre-clean"> + <delete dir="${build.dir}" failonerror="false" /> + <delete dir="${results.dir}" failonerror="false"/> - <target name="pre-clean"> - <delete dir="${build.dir}" failonerror="false" /> - <delete dir="${results.dir}" failonerror="false"/> + <mkdir dir="${build.dir}" /> + <mkdir dir="${results.dir}" /> + <mkdir dir="${archive.dir}" unless="${directory::exists(archive.dir)}" /> - <mkdir dir="${build.dir}" /> - <mkdir dir="${results.dir}" /> - - <call target="cleanJunk" /> - </target> - - <target name="cleanJunk"> - <delete failonerror="false"> - <fileset basedir="."> - <include name="source/**/obj/**"/> - <include name="source/**/bin**"/> - <include name="**/_ReSharper*"/> - <include name="source/**/*.resharperoptions"/> - </fileset> - </delete> - </target> + <call target="cleanJunk" /> + </target> - <target name="version" description="mark AssemblyInfo builds with the build number"> - <property name="assembly-version" value="${project.version}.0000" /> - - <if test="${property::exists('CCNetLabel')}"> - <property name="assembly-version" value="${project.version}.${CCNetLabel}" /> - </if> - - <echo message="Marking this build as version ${assembly-version}" /> - <asminfo output="Source/CommonAssemblyInfo.cs" language="CSharp"> - <imports> - <import namespace="System" /> - <import namespace="System.Reflection" /> - <import namespace="System.Runtime.InteropServices" /> - </imports> - <attributes> - <attribute type="ComVisibleAttribute" value="false" /> - <attribute type="AssemblyVersionAttribute" value="${assembly-version}" /> - <attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2003-2008, Jeremy D. Miller" /> - <attribute type="AssemblyProductAttribute" value="StructureMap" /> - <attribute type="AssemblyCompanyAttribute" value="" /> - <attribute type="AssemblyConfigurationAttribute" value="${project.config}" /> - <attribute type="AssemblyInformationalVersionAttribute" value="${assembly-version}" /> - <attribute type="AssemblyFileVersionAttribute" value="${assembly-version}" /> - </attributes> - <references> - <include name="System.dll" /> - </references> - </asminfo> - </target> + <target name="cleanJunk"> + <delete failonerror="false"> + <fileset basedir="."> + <include name="source/**/obj/**"/> + <include name="source/**/bin**"/> + <include name="**/_ReSharper*"/> + <include name="source/**/*.resharperoptions"/> + </fileset> + </delete> + </target> + <target name="version" description="mark AssemblyInfo builds with the build number"> + <property name="assembly-version" value="${project.version}.0000" /> + <if test="${environment::variable-exists('BUILD_VCS_NUMBER_SourceForge_SVN')}"> + <property name="assembly-version" value="${project.version}.${environment::get-variable('BUILD_VCS_NUMBER_SourceForge_SVN')}" /> + </if> - <target name="compile" depends="pre-clean,version"> + <echo message="Marking this build as version ${assembly-version}" /> + <tc-buildnumber build-number="${assembly-version}_${'{build.number}'}" /> + <asminfo output="Source/CommonAssemblyInfo.cs" language="CSharp"> + <imports> + <import namespace="System" /> + <import namespace="System.Reflection" /> + <import namespace="System.Runtime.InteropServices" /> + </imports> + <attributes> + <attribute type="ComVisibleAttribute" value="false" /> + <attribute type="AssemblyVersionAttribute" value="${assembly-version}" /> + <attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2003-2008, Jeremy D. Miller" /> + <attribute type="AssemblyProductAttribute" value="StructureMap" /> + <attribute type="AssemblyCompanyAttribute" value="" /> + <attribute type="AssemblyConfigurationAttribute" value="${project.config}" /> + <attribute type="AssemblyInformationalVersionAttribute" value="${assembly-version}" /> + <attribute type="AssemblyFileVersionAttribute" value="${assembly-version}" /> + </attributes> + <references> + <include name="System.dll" /> + </references> + </asminfo> + </target> + + + <target name="compile" depends="pre-clean,version"> <exec program="${nant.settings.currentframework.frameworkdirectory}\msbuild.exe" commandline="source\StructureMap.sln /t:rebuild /p:Configuration=Release"> </exec> - <copy todir="${build.dir}" flatten="true" overwrite="true"> - <fileset basedir="source\"> - <include name="**\bin\${project.config}\*.dll" /> - <include name="**\bin\${project.config}\*.exe" /> - <include name="**\bin\${project.config}\*.pdb" /> - <include name="**\bin\${project.config}\*.xml" /> - <include name="**\bin\${project.config}\*.xml.actual" /> - <include name="StructureMap.Testing\*.config" /> - </fileset> - </copy> + <copy todir="${build.dir}" flatten="true" overwrite="true"> + <fileset basedir="source\"> + <include name="**\bin\${project.config}\*.dll" /> + <include name="**\bin\${project.config}\*.exe" /> + <include name="**\bin\${project.config}\*.pdb" /> + <include name="**\bin\${project.config}\*.xml" /> + <include name="**\bin\${project.config}\*.xml.actual" /> + <include name="StructureMap.Testing\*.config" /> + </fileset> + </copy> <copy todir="${build.dir}\..\" flatten="true" overwrite="true"> <fileset basedir="source\"> <include name="StructureMap.Testing\StructureMap.config" /> </fileset> </copy> - </target> + </target> - <target name="unit-test"> + <target name="unit-test"> <property name="nunit-console.exe" value="bin\NUnit\nunit-console.exe" /> <exec program="${nunit-console.exe}" workingdir="${build.dir}"> - <arg value="StructureMap.Testing.dll" /> + <arg value="StructureMap.Testing.dll" /> </exec> <exec program="${nunit-console.exe}" workingdir="${build.dir}"> <arg value="StructureMap.DebuggerVisualizers.Testing.exe" /> @@ -98,61 +100,61 @@ </target> - - <target name="runDoctor"> - <echo message="Running StructureMapDoctor" /> - <copy file="source\StructureMap.Testing\TestData\ObjectMother.config" todir="build" verbose="true"/> - - - <exec - program="${build.dir}\StructureMapDoctor.exe" - workingdir="." + + <target name="runDoctor"> + <echo message="Running StructureMapDoctor" /> + <copy file="source\StructureMap.Testing\TestData\ObjectMother.config" todir="build" verbose="true"/> + + + <exec + program="${build.dir}\StructureMapDoctor.exe" + workingdir="." commandline="${build.dir}\ObjectMother.config -All"/> - - <delete file="build/ObjectMother.config" /> - - </target> - - - <target name="post-clean"> - - <delete dir="deploy" failonerror="false" /> - <mkdir dir="deploy" /> + <delete file="build/ObjectMother.config" /> - <copy todir="deploy" flatten="true" overwrite="true"> - <fileset basedir="source\StructureMap.Testing\bin\${project.config}"> - <include name="StructureMap.dll" /> - <include name="StructureMap.xml" /> - <include name="StructureMap.AutoMocking.dll" /> - <include name="StructureMap.AutoMocking.xml" /> + </target> + + + + <target name="post-clean"> + + <delete dir="deploy" failonerror="false" /> + <mkdir dir="deploy" /> + + <copy todir="deploy" flatten="true" overwrite="true"> + <fileset basedir="source\StructureMap.Testing\bin\${project.config}"> + <include name="StructureMap.dll" /> + <include name="StructureMap.xml" /> + <include name="StructureMap.AutoMocking.dll" /> + <include name="StructureMap.AutoMocking.xml" /> + </fileset> + </copy> + + <copy todir="deploy" file="bin\Rhino.Mocks.dll"/> + <copy todir="deploy" file="StructureMap.chm"/> + + <copy todir="deploy" file="Source\StructureMapDoctor\bin\${project.config}\StructureMapDoctor.exe" /> + + <call target="cleanJunk" /> + </target> + + + <target name="archive"> + <if test="${cibuild}"> + <zip zipfile="${archive.dir}\StructureMap_${BUILD_NUMBER}.zip" if="${property::exists('BUILD_NUMBER')}"> + <fileset basedir="${build.dir}"> + <include name="*.dll" /> + <include name="*.exe" /> + <exclude name="*.xml" /> </fileset> - </copy> + </zip> - <copy todir="deploy" file="bin\Rhino.Mocks.dll"/> - <copy todir="deploy" file="StructureMap.chm"/> - - <copy todir="deploy" file="Source\StructureMapDoctor\bin\${project.config}\StructureMapDoctor.exe" /> - <call target="cleanJunk" /> - </target> - - - <target name="archive"> - <if test="${property::exists('CCNetLabel')}"> - <zip zipfile="${archive.dir}\StructureMap_${CCNetLabel}.zip" if="${property::exists('CCNetLabel')}"> - <fileset basedir="${build.dir}"> - <include name="*.dll" /> - <include name="*.exe" /> - <exclude name="*.xml" /> - </fileset> - </zip> - - - <nant buildfile="Deploy.build" inheritall="true"/> - </if> - - - </target> + <nant buildfile="Deploy.build" inheritall="true"/> + </if> + + </target> + </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2009-06-03 02:35:50
|
Revision: 243 http://structuremap.svn.sourceforge.net/structuremap/?rev=243&view=rev Author: flimflan Date: 2009-06-03 02:35:48 +0000 (Wed, 03 Jun 2009) Log Message: ----------- Fixing some build issues Modified Paths: -------------- trunk/cruise.build Property Changed: ---------------- trunk/Source/ Property changes on: trunk/Source ___________________________________________________________________ Modified: svn:ignore - *.suo _ReSharper.StructureMap PrecompiledWeb *.resharper *.user Ankh.Load _UpgradeReport_Files UpgradeLog.XML UpgradeLog2.XML UpgradeLog3.XML UpgradeLog4.XML *.cache + *.suo _ReSharper.StructureMap PrecompiledWeb *.resharper *.user Ankh.Load _UpgradeReport_Files UpgradeLog.XML UpgradeLog2.XML UpgradeLog3.XML UpgradeLog4.XML *.cache CommonAssemblyInfo.cs Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2009-06-03 02:16:54 UTC (rev 242) +++ trunk/cruise.build 2009-06-03 02:35:48 UTC (rev 243) @@ -1,4 +1,5 @@ <project name="StructureMap" default="all"> + <loadtasks assembly="bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.dll" /> <property name="build.dir" value="build" /> <property name="deployment.dir" value="source\StructureMap.Testing.DeploymentTasks\"/> <property name="results.dir" value="results" /> @@ -142,7 +143,7 @@ <target name="archive"> <if test="${cibuild}"> - <zip zipfile="${archive.dir}\StructureMap_${BUILD_NUMBER}.zip" if="${property::exists('BUILD_NUMBER')}"> + <zip zipfile="${archive.dir}\StructureMap_${environment::get-variable('BUILD_NUMBER')}.zip" if="${environment::variable-exists('BUILD_NUMBER')}"> <fileset basedir="${build.dir}"> <include name="*.dll" /> <include name="*.exe" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2009-06-03 02:44:09
|
Revision: 244 http://structuremap.svn.sourceforge.net/structuremap/?rev=244&view=rev Author: flimflan Date: 2009-06-03 02:44:07 +0000 (Wed, 03 Jun 2009) Log Message: ----------- Fixing archive step in build Modified Paths: -------------- trunk/bin/nant/lib/ICSharpCode.SharpZipLib.dll trunk/cruise.build Modified: trunk/bin/nant/lib/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2009-06-03 02:35:48 UTC (rev 243) +++ trunk/cruise.build 2009-06-03 02:44:07 UTC (rev 244) @@ -7,8 +7,6 @@ <property name="project.version" value="2.5.4" /> <property name="project.config" value="release" /> <property name="archive.dir" value="archive"/> - <property name="cibuild" value="false" /> - <property name="cibuild" value="true" if="${environment::variable-exists('TEAMCITY_PROJECT_NAME')}" /> <target name="all" depends="compile, unit-test, post-clean"/> <target name="cruise" depends="compile, unit-test, post-clean, archive" /> @@ -41,7 +39,7 @@ </if> <echo message="Marking this build as version ${assembly-version}" /> - <tc-buildnumber build-number="${assembly-version}_${'{build.number}'}" /> + <tc-buildnumber build-number="${'{build.number}'}-${assembly-version}" /> <asminfo output="Source/CommonAssemblyInfo.cs" language="CSharp"> <imports> <import namespace="System" /> @@ -142,7 +140,7 @@ <target name="archive"> - <if test="${cibuild}"> + <if test="${environment::variable-exists('TEAMCITY_PROJECT_NAME')}"> <zip zipfile="${archive.dir}\StructureMap_${environment::get-variable('BUILD_NUMBER')}.zip" if="${environment::variable-exists('BUILD_NUMBER')}"> <fileset basedir="${build.dir}"> <include name="*.dll" /> @@ -150,9 +148,6 @@ <exclude name="*.xml" /> </fileset> </zip> - - - <nant buildfile="Deploy.build" inheritall="true"/> </if> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2009-06-03 02:54:37
|
Revision: 245 http://structuremap.svn.sourceforge.net/structuremap/?rev=245&view=rev Author: flimflan Date: 2009-06-03 02:54:36 +0000 (Wed, 03 Jun 2009) Log Message: ----------- Fixing archive step in build (again) Modified Paths: -------------- trunk/RunBuild.BAT trunk/cruise.build Modified: trunk/RunBuild.BAT =================================================================== --- trunk/RunBuild.BAT 2009-06-03 02:44:07 UTC (rev 244) +++ trunk/RunBuild.BAT 2009-06-03 02:54:36 UTC (rev 245) @@ -1,2 +1,2 @@ -bin\nant\nant.exe -buildfile:cruise.build cruise +bin\nant\nant.exe -buildfile:cruise.build %* pause Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2009-06-03 02:44:07 UTC (rev 244) +++ trunk/cruise.build 2009-06-03 02:54:36 UTC (rev 245) @@ -8,7 +8,7 @@ <property name="project.config" value="release" /> <property name="archive.dir" value="archive"/> <target name="all" depends="compile, unit-test, post-clean"/> - <target name="cruise" depends="compile, unit-test, post-clean, archive" /> + <target name="ci" depends="compile, unit-test, post-clean, archive" /> <target name="pre-clean"> <delete dir="${build.dir}" failonerror="false" /> @@ -39,7 +39,7 @@ </if> <echo message="Marking this build as version ${assembly-version}" /> - <tc-buildnumber build-number="${'{build.number}'}-${assembly-version}" /> + <tc-buildnumber build-number="${assembly-version}-${'{build.number}'}" /> <asminfo output="Source/CommonAssemblyInfo.cs" language="CSharp"> <imports> <import namespace="System" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2009-12-04 23:00:37
|
Revision: 276 http://structuremap.svn.sourceforge.net/structuremap/?rev=276&view=rev Author: flimflan Date: 2009-12-04 23:00:27 +0000 (Fri, 04 Dec 2009) Log Message: ----------- Clean archive folder during build so that only the latest built is stored as an artifact on teamcity.codebetter Modified Paths: -------------- trunk/CleanUp.BAT trunk/cruise.build Modified: trunk/CleanUp.BAT =================================================================== --- trunk/CleanUp.BAT 2009-12-03 20:54:50 UTC (rev 275) +++ trunk/CleanUp.BAT 2009-12-04 23:00:27 UTC (rev 276) @@ -1,2 +1,2 @@ -bin\nant\nant.exe -buildfile:StructureMap.build post-clean +bin\nant\nant.exe -buildfile:cruise.build post-clean pause Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2009-12-03 20:54:50 UTC (rev 275) +++ trunk/cruise.build 2009-12-04 23:00:27 UTC (rev 276) @@ -13,10 +13,11 @@ <target name="pre-clean"> <delete dir="${build.dir}" failonerror="false" /> <delete dir="${results.dir}" failonerror="false"/> + <delete dir="${archive.dir}" failonerror="false" /> <mkdir dir="${build.dir}" /> <mkdir dir="${results.dir}" /> - <mkdir dir="${archive.dir}" unless="${directory::exists(archive.dir)}" /> + <mkdir dir="${archive.dir}" /> <call target="cleanJunk" /> </target> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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] |
From: <jer...@us...> - 2010-02-05 01:17:08
|
Revision: 342 http://structuremap.svn.sourceforge.net/structuremap/?rev=342&view=rev Author: jeremydmiller Date: 2010-02-05 01:16:22 +0000 (Fri, 05 Feb 2010) Log Message: ----------- Pushed the AssemblyScannerExtensions back into real methods Modified Paths: -------------- trunk/Source/StructureMap/Graph/AssemblyScanner.cs trunk/Source/StructureMap/Graph/IAssemblyScanner.cs trunk/Source/StructureMap/StructureMap.csproj trunk/cruise.build Removed Paths: ------------- trunk/Source/StructureMap/Configuration/DSL/AssemblyScannerExtensions.cs Deleted: trunk/Source/StructureMap/Configuration/DSL/AssemblyScannerExtensions.cs =================================================================== --- trunk/Source/StructureMap/Configuration/DSL/AssemblyScannerExtensions.cs 2010-02-04 23:30:20 UTC (rev 341) +++ trunk/Source/StructureMap/Configuration/DSL/AssemblyScannerExtensions.cs 2010-02-05 01:16:22 UTC (rev 342) @@ -1,63 +0,0 @@ -using System; -using StructureMap.Configuration.DSL.Expressions; -using StructureMap.Graph; - -namespace StructureMap.Configuration.DSL -{ - /// <summary> - /// Extend the assembly scanning DSL to support the built-in registration conventions - /// </summary> - public static class AssemblyScannerExtensions - { - /// <summary> - /// Adds the DefaultConventionScanner to the scanning operations. I.e., a concrete - /// class named "Something" that implements "ISomething" will be automatically - /// added to PluginType "ISomething" - /// </summary> - public static ConfigureConventionExpression WithDefaultConventions(this IAssemblyScanner assemblyScanner) - { - var convention = new DefaultConventionScanner(); - assemblyScanner.With(convention); - return new ConfigureConventionExpression(convention); - } - - /// <summary> - /// Scans for PluginType's and Concrete Types that close the given open generic type - /// </summary> - /// <example> - /// - /// </example> - /// <param name="openGenericType"></param> - public static ConfigureConventionExpression ConnectImplementationsToTypesClosing(this IAssemblyScanner assemblyScanner, Type openGenericType) - { - var convention = new GenericConnectionScanner(openGenericType); - assemblyScanner.With(convention); - return new ConfigureConventionExpression(convention); - } - - /// <summary> - /// Automatically registers all concrete types without primitive arguments - /// against its first interface, if any - /// </summary> - public static ConfigureConventionExpression RegisterConcreteTypesAgainstTheFirstInterface(this IAssemblyScanner assemblyScanner) - { - var convention = new FirstInterfaceConvention(); - assemblyScanner.With(convention); - return new ConfigureConventionExpression(convention); - } - - /// <summary> - /// Directs the scanning to automatically register any type that is the single - /// implementation of an interface against that interface. - /// The filters apply - /// </summary> - public static ConfigureConventionExpression SingleImplementationsOfInterface(this IAssemblyScanner assemblyScanner) - { - var convention = new ImplementationMap(); - assemblyScanner.With(convention); - assemblyScanner.ModifyGraphAfterScan(convention.RegisterSingleImplementations); - return new ConfigureConventionExpression(convention); - } - - } -} \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/AssemblyScanner.cs =================================================================== --- trunk/Source/StructureMap/Graph/AssemblyScanner.cs 2010-02-04 23:30:20 UTC (rev 341) +++ trunk/Source/StructureMap/Graph/AssemblyScanner.cs 2010-02-05 01:16:22 UTC (rev 342) @@ -5,6 +5,7 @@ using System.Linq; using System.Reflection; using StructureMap.Configuration.DSL; +using StructureMap.Configuration.DSL.Expressions; using StructureMap.TypeRules; using StructureMap.Util; @@ -280,5 +281,58 @@ } return callingAssembly; } + + + + /// <summary> + /// Adds the DefaultConventionScanner to the scanning operations. I.e., a concrete + /// class named "Something" that implements "ISomething" will be automatically + /// added to PluginType "ISomething" + /// </summary> + public ConfigureConventionExpression WithDefaultConventions() + { + var convention = new DefaultConventionScanner(); + With(convention); + return new ConfigureConventionExpression(convention); + } + + /// <summary> + /// Scans for PluginType's and Concrete Types that close the given open generic type + /// </summary> + /// <example> + /// + /// </example> + /// <param name="openGenericType"></param> + public ConfigureConventionExpression ConnectImplementationsToTypesClosing(Type openGenericType) + { + var convention = new GenericConnectionScanner(openGenericType); + With(convention); + return new ConfigureConventionExpression(convention); + } + + /// <summary> + /// Automatically registers all concrete types without primitive arguments + /// against its first interface, if any + /// </summary> + public ConfigureConventionExpression RegisterConcreteTypesAgainstTheFirstInterface() + { + var convention = new FirstInterfaceConvention(); + With(convention); + return new ConfigureConventionExpression(convention); + } + + /// <summary> + /// Directs the scanning to automatically register any type that is the single + /// implementation of an interface against that interface. + /// The filters apply + /// </summary> + public ConfigureConventionExpression SingleImplementationsOfInterface() + { + var convention = new ImplementationMap(); + With(convention); + ModifyGraphAfterScan(convention.RegisterSingleImplementations); + return new ConfigureConventionExpression(convention); + } + } } \ No newline at end of file Modified: trunk/Source/StructureMap/Graph/IAssemblyScanner.cs =================================================================== --- trunk/Source/StructureMap/Graph/IAssemblyScanner.cs 2010-02-04 23:30:20 UTC (rev 341) +++ trunk/Source/StructureMap/Graph/IAssemblyScanner.cs 2010-02-05 01:16:22 UTC (rev 342) @@ -178,5 +178,34 @@ void With(IRegistrationConvention convention); void ModifyGraphAfterScan(Action<PluginGraph> modifyGraph); + + /// <summary> + /// Adds the DefaultConventionScanner to the scanning operations. I.e., a concrete + /// class named "Something" that implements "ISomething" will be automatically + /// added to PluginType "ISomething" + /// </summary> + ConfigureConventionExpression WithDefaultConventions(); + + /// <summary> + /// Scans for PluginType's and Concrete Types that close the given open generic type + /// </summary> + /// <example> + /// + /// </example> + /// <param name="openGenericType"></param> + ConfigureConventionExpression ConnectImplementationsToTypesClosing(Type openGenericType); + + /// <summary> + /// Automatically registers all concrete types without primitive arguments + /// against its first interface, if any + /// </summary> + ConfigureConventionExpression RegisterConcreteTypesAgainstTheFirstInterface(); + + /// <summary> + /// Directs the scanning to automatically register any type that is the single + /// implementation of an interface against that interface. + /// The filters apply + /// </summary> + ConfigureConventionExpression SingleImplementationsOfInterface(); } } \ No newline at end of file Modified: trunk/Source/StructureMap/StructureMap.csproj =================================================================== --- trunk/Source/StructureMap/StructureMap.csproj 2010-02-04 23:30:20 UTC (rev 341) +++ trunk/Source/StructureMap/StructureMap.csproj 2010-02-05 01:16:22 UTC (rev 342) @@ -336,7 +336,6 @@ <Compile Include="CloseGenericTypeExpression.cs" /> <Compile Include="ConfigurationExpression.cs" /> <Compile Include="Configuration\DictionaryReader.cs" /> - <Compile Include="Configuration\DSL\AssemblyScannerExtensions.cs" /> <Compile Include="Configuration\DSL\Expressions\InstanceExpression.cs" /> <Compile Include="Configuration\DSL\IRegistry.cs" /> <Compile Include="Configuration\DSL\SetterConvention.cs" /> Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2010-02-04 23:30:20 UTC (rev 341) +++ trunk/cruise.build 2010-02-05 01:16:22 UTC (rev 342) @@ -4,7 +4,7 @@ <property name="deployment.dir" value="source\StructureMap.Testing.DeploymentTasks\"/> <property name="results.dir" value="results" /> <property name="nant.dir" value="bin\nant" /> - <property name="project.version" value="2.6.0" /> + <property name="project.version" value="2.6.1" /> <property name="project.config" value="release" /> <property name="archive.dir" value="archive"/> <target name="all" depends="compile, unit-test, post-clean"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jer...@us...> - 2010-02-11 02:44:07
|
Revision: 347 http://structuremap.svn.sourceforge.net/structuremap/?rev=347&view=rev Author: jeremydmiller Date: 2010-02-11 02:43:57 +0000 (Thu, 11 Feb 2010) Log Message: ----------- Fixing a bug with IContext.GetAllInstances<T>() Modified Paths: -------------- trunk/Source/StructureMap/BuildSession.cs trunk/Source/StructureMap.Testing/BuildSessionTester.cs trunk/Source/StructureMap.Testing/Configuration/DSL/InterceptorTesting.cs trunk/Source/StructureMap.Testing/Examples.cs trunk/Source/StructureMap.Testing/Pipeline/ContainerDisposalTester.cs trunk/Source/StructureMap.Testing/Pipeline/NestedContainerSupportTester.cs trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj trunk/Source/StructureMap.Testing.Widget3/IService.cs trunk/cruise.build Added Paths: ----------- trunk/Source/StructureMap.Testing/Bugs/EnumerableShouldGetAllValuesTester.cs Modified: trunk/Source/StructureMap/BuildSession.cs =================================================================== --- trunk/Source/StructureMap/BuildSession.cs 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap/BuildSession.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -119,7 +119,7 @@ public IEnumerable<T> GetAllInstances<T>() { - return forType(typeof (T)).AllInstances.Select(x => GetInstance<T>()); + return (IEnumerable<T>) forType(typeof (T)).AllInstances.Select(x => (T)CreateInstance(typeof(T), x)); } protected void clearBuildStack() Added: trunk/Source/StructureMap.Testing/Bugs/EnumerableShouldGetAllValuesTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Bugs/EnumerableShouldGetAllValuesTester.cs (rev 0) +++ trunk/Source/StructureMap.Testing/Bugs/EnumerableShouldGetAllValuesTester.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -0,0 +1,44 @@ +using System.Collections.Generic; +using NUnit.Framework; +using StructureMap.Testing.Widget; +using System.Linq; + +namespace StructureMap.Testing.Bugs +{ + [TestFixture] + public class EnumerableShouldGetAllValuesTester + { + [SetUp] + public void SetUp() + { + } + + [Test] + public void ienumerable_arg_should_get_all_registered() + { + var container = new Container(x => + { + x.For<IWidget>().AddInstances(o => + { + o.Type<ColorWidget>().Ctor<string>("color").Is("red"); + o.Type<ColorWidget>().Ctor<string>("color").Is("blue"); + o.Type<ColorWidget>().Ctor<string>("color").Is("green"); + }); + }); + + container.GetInstance<ClassWithEnumerable>().Widgets.Count().ShouldEqual(3); + } + + public class ClassWithEnumerable + { + private readonly IEnumerable<IWidget> _widgets; + + public ClassWithEnumerable(IEnumerable<IWidget> widgets) + { + _widgets = widgets; + } + + public IEnumerable<IWidget> Widgets { get { return _widgets; } } + } + } +} \ No newline at end of file Modified: trunk/Source/StructureMap.Testing/BuildSessionTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/BuildSessionTester.cs 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap.Testing/BuildSessionTester.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -67,7 +67,49 @@ container.GetInstance<TopClass>().Widgets.Count().ShouldEqual(4); } + [Test] + public void can_get_all_of_a_type_during_object_creation_as_generic_type() + { + var container = new Container(x => + { + x.For<IWidget>().AddInstances(o => + { + o.OfConcreteType<AWidget>(); + o.ConstructedBy(() => new ColorWidget("red")); + o.ConstructedBy(() => new ColorWidget("blue")); + o.ConstructedBy(() => new ColorWidget("green")); + }); + + x.ForConcreteType<TopClass>().Configure.OnCreation( + (c, top) => { top.Widgets = c.All<IWidget>().ToArray(); }); + }); + + container.GetInstance<TopClass>().Widgets.Count().ShouldEqual(4); + } + + + [Test] + public void can_get_all_of_a_type_by_GetAllInstances_during_object_creation_as_generic_type() + { + var container = new Container(x => + { + x.For<IWidget>().AddInstances(o => + { + o.OfConcreteType<AWidget>(); + o.ConstructedBy(() => new ColorWidget("red")); + o.ConstructedBy(() => new ColorWidget("blue")); + o.ConstructedBy(() => new ColorWidget("green")); + }); + + x.ForConcreteType<TopClass>().Configure.OnCreation( + (c, top) => { top.Widgets = c.GetAllInstances<IWidget>().ToArray(); }); + }); + + container.GetInstance<TopClass>().Widgets.Count().ShouldEqual(4); + } + + [Test] public void Get_a_unique_value_for_each_individual_buildsession() { int count = 0; Modified: trunk/Source/StructureMap.Testing/Configuration/DSL/InterceptorTesting.cs =================================================================== --- trunk/Source/StructureMap.Testing/Configuration/DSL/InterceptorTesting.cs 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap.Testing/Configuration/DSL/InterceptorTesting.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -150,6 +150,10 @@ public IService Inner { get { return _inner; } } + public void DoSomething() + { + throw new NotImplementedException(); + } } public class ContextRecorder Modified: trunk/Source/StructureMap.Testing/Examples.cs =================================================================== --- trunk/Source/StructureMap.Testing/Examples.cs 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap.Testing/Examples.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -403,6 +403,10 @@ public class RemoteService : IService { + public void DoSomething() + { + throw new NotImplementedException(); + } } public class InstanceExampleRegistry : Registry Modified: trunk/Source/StructureMap.Testing/Pipeline/ContainerDisposalTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Pipeline/ContainerDisposalTester.cs 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap.Testing/Pipeline/ContainerDisposalTester.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -1,5 +1,6 @@ using System; using NUnit.Framework; +using StructureMap.Testing.Widget3; namespace StructureMap.Testing.Pipeline { Modified: trunk/Source/StructureMap.Testing/Pipeline/NestedContainerSupportTester.cs =================================================================== --- trunk/Source/StructureMap.Testing/Pipeline/NestedContainerSupportTester.cs 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap.Testing/Pipeline/NestedContainerSupportTester.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -206,7 +206,11 @@ [Test] public void transient_service_in_the_parent_container_is_effectively_a_singleton_for_the_nested_container() { - var parent = new Container(x => { x.For<IWidget>().Use<AWidget>(); }); + var parent = new Container(x => + { + // IWidget is a "transient" + x.For<IWidget>().Use<AWidget>(); + }); IContainer child = parent.GetNestedContainer(); Modified: trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj =================================================================== --- trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap.Testing/StructureMap.Testing.csproj 2010-02-11 02:43:57 UTC (rev 347) @@ -180,6 +180,7 @@ <Compile Include="BidirectionalDependencies.cs" /> <Compile Include="Bugs\AddValueDirectlyWithGenericUsage.cs" /> <Compile Include="Bugs\BuildUpBug.cs" /> + <Compile Include="Bugs\EnumerableShouldGetAllValuesTester.cs" /> <Compile Include="Bugs\FillAllPropertiesShouldWorkForAlreadyConfiguredPluginsBug.cs" /> <Compile Include="Bugs\HttpSessionNullRefBug.cs" /> <Compile Include="Bugs\IDictionaryAndXmlBugTester.cs" /> Modified: trunk/Source/StructureMap.Testing.Widget3/IService.cs =================================================================== --- trunk/Source/StructureMap.Testing.Widget3/IService.cs 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/Source/StructureMap.Testing.Widget3/IService.cs 2010-02-11 02:43:57 UTC (rev 347) @@ -1,3 +1,5 @@ +using System; + namespace StructureMap.Testing.Widget3 { public interface IService : IBasicService @@ -2,2 +4,3 @@ { + void DoSomething(); } @@ -25,5 +28,10 @@ { return "ColorService: " + _color; } + + public void DoSomething() + { + throw new NotImplementedException(); + } } } \ No newline at end of file Modified: trunk/cruise.build =================================================================== --- trunk/cruise.build 2010-02-10 00:14:42 UTC (rev 346) +++ trunk/cruise.build 2010-02-11 02:43:57 UTC (rev 347) @@ -4,7 +4,7 @@ <property name="deployment.dir" value="source\StructureMap.Testing.DeploymentTasks\"/> <property name="results.dir" value="results" /> <property name="nant.dir" value="bin\nant" /> - <property name="project.version" value="2.6.2" /> + <property name="project.version" value="2.6.1" /> <property name="project.config" value="release" /> <property name="archive.dir" value="archive"/> <target name="all" depends="compile, unit-test, post-clean"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fli...@us...> - 2010-03-08 01:03:32
|
Revision: 350 http://structuremap.svn.sourceforge.net/structuremap/?rev=350&view=rev Author: flimflan Date: 2010-03-08 01:03:25 +0000 (Mon, 08 Mar 2010) Log Message: ----------- Removing trunk source code to avoid confusion. All ongoing development is at http://github.com/structuremap/structuremap Last state of trunk is still available read-only under branches/trunk_before_github_move Added Paths: ----------- trunk/moved_to_github.txt Removed Paths: ------------- trunk/CleanUp.BAT trunk/Docs/ trunk/Icons/ trunk/LICENSE.TXT trunk/README.TXT trunk/RunBuild.BAT trunk/Source/ trunk/StructureMap.chm trunk/StructureMap.config trunk/bin/ trunk/cruise.build trunk/nunitTests.config Deleted: trunk/CleanUp.BAT =================================================================== --- trunk/CleanUp.BAT 2010-03-08 00:57:51 UTC (rev 349) +++ trunk/CleanUp.BAT 2010-03-08 01:03:25 UTC (rev 350) @@ -1,2 +0,0 @@ -bin\nant\nant.exe -buildfile:cruise.build post-clean -pause Deleted: trunk/LICENSE.TXT =================================================================== --- trunk/LICENSE.TXT 2010-03-08 00:57:51 UTC (rev 349) +++ trunk/LICENSE.TXT 2010-03-08 01:03:25 UTC (rev 350) @@ -1,194 +0,0 @@ -StructureMap - -Copyright 2004-2009 Jeremy D. Miller - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS \ No newline at end of file Deleted: trunk/README.TXT =================================================================== --- trunk/README.TXT 2010-03-08 00:57:51 UTC (rev 349) +++ trunk/README.TXT 2010-03-08 01:03:25 UTC (rev 350) @@ -1,16 +0,0 @@ -To start using StructureMap, either use the DLL's in the "deploy" folder or click on the RunBuild.BAT file to run the full NAnt build. There is a known issue with the build "sticking" on the custom NAnt tasks. If this happens, delete the copies of StructureMap.Dll and StructureMap.DeploymentTasks.Dll in the bin\NAnt folder. Look in the "build" directory for the build products. - -To enable the debugger visualizers in Visual Studio 2008, put a copy of StructureMap.dll and StructureMap.DebuggerVisualizers.dll in "<My Documents>\Visual Studio 2008\Visualizers" -**WARNING: The visualizer is very early and not well tested. You may experience issues (unhandled exceptions while using the visualizer) if the version of StructureMap.dll in your project is not the exact version in your Visualizers folder. - -A copy of the StructureMap website and documentation is in the "Docs" folder. - - -Please post any questions or bugs to the StructureMap Users mailing list: -http://groups.google.com/group/structuremap-users - - -The latest code and documentation is available on SourceForge: -http://structuremap.sourceforge.net/ - -Thanks for trying StructureMap. Deleted: trunk/RunBuild.BAT =================================================================== --- trunk/RunBuild.BAT 2010-03-08 00:57:51 UTC (rev 349) +++ trunk/RunBuild.BAT 2010-03-08 01:03:25 UTC (rev 350) @@ -1,2 +0,0 @@ -bin\nant\nant.exe -buildfile:cruise.build %* -pause Deleted: trunk/StructureMap.chm =================================================================== (Binary files differ) Deleted: trunk/StructureMap.config =================================================================== --- trunk/StructureMap.config 2010-03-08 00:57:51 UTC (rev 349) +++ trunk/StructureMap.config 2010-03-08 01:03:25 UTC (rev 350) @@ -1,99 +0,0 @@ -<!--<?xml version="1.0" encoding="utf-8" ?>--> -<StructureMap DefaultProfile="TheDefaultProfile" Id="Main"> - <Assembly Name="StructureMap.Testing.Widget" Deploy="Client, Test, Server"/> - <Assembly Name="StructureMap.Testing.Widget2" Deploy="Remote"/> - <Assembly Name="StructureMap.Testing.Widget3"/> - - - <Profile Name="TheDefaultProfile"> - <Override Type="StructureMap.Testing.Widget.GrandChild,StructureMap.Testing.Widget" DefaultKey="Todd"/> - </Profile> - - <PluginFamily Type="StructureMap.Testing.Widget.IWidget" Assembly="StructureMap.Testing.Widget" DefaultKey="Red"> - <Source Type="XmlFile" FilePath="FullTesting.XML" XPath="Widgets" NodeName="Widget"/> - <Plugin Assembly="StructureMap.Testing.Widget" Type="StructureMap.Testing.Widget.NotPluggableWidget" ConcreteKey="NotPluggable"/> - </PluginFamily> - - <!-- If no source is defined, use the default MementoSource --> - <PluginFamily Type="StructureMap.Testing.Widget.Column" Assembly="StructureMap.Testing.Widget"> - <Source Type="XmlFile" FilePath="FullTesting.XML" XPath="Columns" NodeName="Columns" /> - </PluginFamily> - - - <PluginFamily Type="StructureMap.Testing.Widget.Rule" Assembly="StructureMap.Testing.Widget" DefaultKey="Blue"> - <Interceptors> - <Interceptor Type="Singleton"></Interceptor> - </Interceptors> - - <Instance Key="Red" Type="Color"> - <Property Name="color" Value="Red" /> - </Instance> - <Instance Key="Blue" Type="Color"> - <Property Name="color" Value="Blue" /> - </Instance> - <Instance Key="Bigger" Type="GreaterThan"> - <Property Name="Attribute" Value="MyDad" /> - <Property Name="Value" Value="10" /> - </Instance> - </PluginFamily> - - <AddInstance PluginType="StructureMap.Testing.Widget.GrandChild, StructureMap.Testing.Widget" Type="Default" Key="Tommy"> - <Property Name="RightHanded" Value="true" /> - <Property Name="BirthYear" Value="1972" /> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.GrandChild, StructureMap.Testing.Widget" Type="Default" Key="Todd"> - <Property Name="RightHanded" Value="true" /> - <Property Name="BirthYear" Value="1975" /> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.GrandChild, StructureMap.Testing.Widget" Type="Leftie" Key="Trevor"> - <Property Name="BirthYear" Value="1979" /> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.Child, StructureMap.Testing.Widget" Type="Default" Key="Tom"> - <Property Name="Name" Value="Tom" /> - <Property Name="MyGrandChild" Type="Leftie"> - <Property Name="BirthYear" Value="1984" /> - </Property> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.Child, StructureMap.Testing.Widget" Type="Default" Key="Marsha"> - <Property Name="Name" Value="Marsha"/> - <Property Name="MyGrandChild" Key="Tommy"/> - </AddInstance> - - - <AddInstance PluginType="StructureMap.Testing.Widget.Child, StructureMap.Testing.Widget" Type="Default" Key="Jessica"> - <Property Name="Name" Value="Jessica"/> - <Property Name="MyGrandChild"/> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.Child, StructureMap.Testing.Widget" Type="Default" Key="Monte"> - <Property Name="Name" Value="Monte"/> - <Property Name="MyGrandChild" Key="NotARealGrandchild"/> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.Parent, StructureMap.Testing.Widget" Type="Default" Key="Jerry"> - <Property Name="Age" Value="72"/> - <Property Name="EyeColor" Value="Blue"/> - <Property Name="MyChild" Key="Marsha"/> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.Parent, StructureMap.Testing.Widget" Type="Default" Key="Jackie"> - <Property Name="Age" Value="70"/> - <Property Name="EyeColor" Value="Green"/> - <Property Name="MyChild" Type="Default"> - <Property Name="Name" Value="Elizabeth"/> - <Property Name="MyGrandChild" Type="Leftie"> - <Property Name="BirthYear" Value="1992"/> - </Property> - </Property> - </AddInstance> - - <AddInstance PluginType="StructureMap.Testing.Widget.WidgetMaker, StructureMap.Testing.Widget" Type="Color" Key="Red"> - <Property Name="color" Value="Red" /> - </AddInstance> - - -</StructureMap> Deleted: trunk/cruise.build =================================================================== --- trunk/cruise.build 2010-03-08 00:57:51 UTC (rev 349) +++ trunk/cruise.build 2010-03-08 01:03:25 UTC (rev 350) @@ -1,160 +0,0 @@ -<project name="StructureMap" default="all"> - <loadtasks assembly="bin/nant/extensions/common/2.0/NAntExtensions.TeamCity.dll" /> - <property name="build.dir" value="build" /> - <property name="deployment.dir" value="source\StructureMap.Testing.DeploymentTasks\"/> - <property name="results.dir" value="results" /> - <property name="nant.dir" value="bin\nant" /> - <property name="project.version" value="2.6.2" /> - <property name="project.config" value="release" /> - <property name="archive.dir" value="archive"/> - <target name="all" depends="compile, unit-test, post-clean"/> - <target name="release" depends="compile, post-clean"/> - <target name="ci" depends="compile, unit-test, post-clean, archive" /> - - <target name="pre-clean"> - <delete dir="${build.dir}" failonerror="false" /> - <delete dir="${results.dir}" failonerror="false"/> - <delete dir="${archive.dir}" failonerror="false" /> - - <mkdir dir="${build.dir}" /> - <mkdir dir="${results.dir}" /> - <mkdir dir="${archive.dir}" /> - - <call target="cleanJunk" /> - </target> - - <target name="cleanJunk"> - <delete failonerror="false"> - <fileset basedir="."> - <include name="source/**/obj/**"/> - <include name="source/**/bin**"/> - <include name="**/_ReSharper*"/> - <include name="source/**/*.resharperoptions"/> - </fileset> - </delete> - </target> - - <target name="version" description="mark AssemblyInfo builds with the build number"> - <property name="assembly-version" value="${project.version}.0000" /> - <property name="file-version" value="${project.version}.0000" /> - <if test="${environment::variable-exists('BUILD_VCS_NUMBER_SourceForge_SVN')}"> - <property name="file-version" value="${project.version}.${environment::get-variable('BUILD_VCS_NUMBER_SourceForge_SVN')}" /> - </if> - - <echo message="Marking this build as version ${assembly-version}" /> - <tc-buildnumber build-number="${assembly-version}-${'{build.number}'}" /> - <asminfo output="Source/CommonAssemblyInfo.cs" language="CSharp"> - <imports> - <import namespace="System" /> - <import namespace="System.Reflection" /> - <import namespace="System.Runtime.InteropServices" /> - </imports> - <attributes> - <attribute type="ComVisibleAttribute" value="false" /> - <attribute type="AssemblyVersionAttribute" value="${assembly-version}" /> - <attribute type="AssemblyCopyrightAttribute" value="Copyright (c) 2003-2008, Jeremy D. Miller" /> - <attribute type="AssemblyProductAttribute" value="StructureMap" /> - <attribute type="AssemblyCompanyAttribute" value="" /> - <attribute type="AssemblyConfigurationAttribute" value="${project.config}" /> - <attribute type="AssemblyInformationalVersionAttribute" value="${file-version}" /> - <attribute type="AssemblyFileVersionAttribute" value="${file-version}" /> - </attributes> - <references> - <include name="System.dll" /> - </references> - </asminfo> - </target> - - - <target name="compile" depends="pre-clean,version"> - <exec program="${nant.settings.currentframework.frameworkdirectory}\msbuild.exe" commandline="source\StructureMap.sln /t:rebuild /p:Configuration=Release"> - </exec> - - <copy todir="${build.dir}" flatten="true" overwrite="true"> - <fileset basedir="source\"> - <include name="**\bin\${project.config}\*.dll" /> - <include name="**\bin\${project.config}\*.exe" /> - <include name="**\bin\${project.config}\*.pdb" /> - <include name="**\bin\${project.config}\*.xml" /> - <include name="**\bin\${project.config}\*.xml.actual" /> - <include name="StructureMap.Testing\*.config" /> - </fileset> - </copy> - <copy todir="${build.dir}\..\" flatten="true" overwrite="true"> - <fileset basedir="source\"> - <include name="StructureMap.Testing\StructureMap.config" /> - </fileset> - </copy> - - </target> - - - - <target name="unit-test"> - <property name="nunit-console.exe" value="bin\NUnit\nunit-console.exe" /> - - <exec program="${nunit-console.exe}" workingdir="${build.dir}"> - <arg value="StructureMap.Testing.dll" /> - </exec> - <exec program="${nunit-console.exe}" workingdir="${build.dir}"> - <arg value="StructureMap.DebuggerVisualizers.Testing.exe" /> - </exec> - - - </target> - - <target name="runDoctor"> - <echo message="Running StructureMapDoctor" /> - <copy file="source\StructureMap.Testing\TestData\ObjectMother.config" todir="build" verbose="true"/> - - - <exec - program="${build.dir}\StructureMapDoctor.exe" - workingdir="." - commandline="${build.dir}\ObjectMother.config -All"/> - - <delete file="build/ObjectMother.config" /> - - </target> - - - - <target name="post-clean"> - - <delete dir="deploy" failonerror="false" /> - <mkdir dir="deploy" /> - - <copy todir="deploy" flatten="true" overwrite="true"> - <fileset basedir="source\StructureMap.Testing\bin\${project.config}"> - <include name="StructureMap.dll" /> - <include name="StructureMap.xml" /> - <include name="StructureMap.AutoMocking.dll" /> - <include name="StructureMap.AutoMocking.xml" /> - </fileset> - </copy> - - <copy todir="deploy" file="bin\Rhino.Mocks.dll"/> - <copy todir="deploy" file="StructureMap.chm"/> - <copy todir="deploy" file="LICENSE.TXT"/> - - <copy todir="deploy" file="Source\StructureMapDoctor\bin\${project.config}\StructureMapDoctor.exe" /> - - <call target="cleanJunk" /> - </target> - - - <target name="archive" depends="version"> - <if test="${environment::variable-exists('TEAMCITY_PROJECT_NAME')}"> - <zip zipfile="${archive.dir}\StructureMap_${assembly-version}.zip"> - <fileset basedir="${build.dir}"> - <include name="*.dll" /> - <include name="*.exe" /> - <exclude name="*.xml" /> - </fileset> - </zip> - </if> - - - </target> - -</project> \ No newline at end of file Added: trunk/moved_to_github.txt =================================================================== --- trunk/moved_to_github.txt (rev 0) +++ trunk/moved_to_github.txt 2010-03-08 01:03:25 UTC (rev 350) @@ -0,0 +1,5 @@ +StructureMap has moved to github http://github.com/structuremap/structuremap + +The entire trunk history was migrated to git. +Branches were not migrated, but still exist as read-only in subversion on sourceforge. +The last state of the trunk was saved in a branch at branches/trunk_before_github_move \ No newline at end of file Deleted: trunk/nunitTests.config =================================================================== --- trunk/nunitTests.config 2010-03-08 00:57:51 UTC (rev 349) +++ trunk/nunitTests.config 2010-03-08 01:03:25 UTC (rev 350) @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<configuration> - - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - <dependentAssembly> - <assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" /> - <bindingRedirect oldVersion="2.2.5.0" newVersion="2.2.0.0" /> - </dependentAssembly> - </assemblyBinding> - </runtime> - -</configuration> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |