|
From: <jer...@us...> - 2008-06-15 14:28:16
|
Revision: 122
http://structuremap.svn.sourceforge.net/structuremap/?rev=122&view=rev
Author: jeremydmiller
Date: 2008-06-15 07:28:14 -0700 (Sun, 15 Jun 2008)
Log Message:
-----------
cleaning up the xml parsing
Modified Paths:
--------------
trunk/Source/StructureMap/Configuration/FamilyParser.cs
trunk/Source/StructureMap/Diagnostics/Error.cs
trunk/Source/StructureMap/Graph/PluginFamily.cs
trunk/Source/StructureMap.Testing/Configuration/ConfigurationParserBuilderTester.cs
Modified: trunk/Source/StructureMap/Configuration/FamilyParser.cs
===================================================================
--- trunk/Source/StructureMap/Configuration/FamilyParser.cs 2008-06-15 01:49:31 UTC (rev 121)
+++ trunk/Source/StructureMap/Configuration/FamilyParser.cs 2008-06-15 14:28:14 UTC (rev 122)
@@ -30,12 +30,17 @@
family.SetScopeTo(scope);
attachMementoSource(family, familyElement);
- familyElement.ForEachChild(PLUGIN_NODE).Do(element => attachPlugin(element, family));
+ attachPlugins(family, familyElement);
attachInterceptors(family, familyElement);
attachInstances(family, familyElement, _builder);
});
}
+ private void attachPlugins(PluginFamily family, XmlElement familyElement)
+ {
+ familyElement.ForEachChild(PLUGIN_NODE).Do(element => attachPlugin(element, family));
+ }
+
private void attachInstances(PluginFamily family, XmlElement familyElement, IGraphBuilder builder)
{
familyElement.ForEachChild(INSTANCE_NODE).Do(element =>
@@ -108,7 +113,6 @@
family.AddPlugin(plugin);
pluginElement.ForTextInChild("Setter/@Name").Do(prop => plugin.Setters.Add(prop));
-
});
}
@@ -119,8 +123,10 @@
{
var interceptorMemento = new XmlAttributeInstanceMemento(element);
string context = contextBase + element.OuterXml;
- _builder.WithSystemObject<IBuildInterceptor>(interceptorMemento, context,
- interceptor => family.AddInterceptor(interceptor));
+ _builder.WithSystemObject<IBuildInterceptor>(
+ interceptorMemento,
+ context,
+ interceptor => family.AddInterceptor(interceptor));
});
}
}
Modified: trunk/Source/StructureMap/Diagnostics/Error.cs
===================================================================
--- trunk/Source/StructureMap/Diagnostics/Error.cs 2008-06-15 01:49:31 UTC (rev 121)
+++ trunk/Source/StructureMap/Diagnostics/Error.cs 2008-06-15 14:28:14 UTC (rev 122)
@@ -88,7 +88,6 @@
public void Write(StringWriter writer)
{
- // TODO: hit with an extension method for 3.5
writer.WriteLine("Error: " + Code);
if (Instance != null) writer.WriteLine(Instance.ToString());
writer.WriteLine("Source: " + Source);
Modified: trunk/Source/StructureMap/Graph/PluginFamily.cs
===================================================================
--- trunk/Source/StructureMap/Graph/PluginFamily.cs 2008-06-15 01:49:31 UTC (rev 121)
+++ trunk/Source/StructureMap/Graph/PluginFamily.cs 2008-06-15 14:28:14 UTC (rev 122)
@@ -148,7 +148,6 @@
private void discoverImplicitInstances()
{
- // TODO: Apply some 3.5 lambda magic. Maybe move to PluginCollection
List<Plugin> list = _plugins.FindAutoFillablePlugins();
list.RemoveAll(
plugin => _instances.Exists(instance => instance.Matches(plugin)));
Modified: trunk/Source/StructureMap.Testing/Configuration/ConfigurationParserBuilderTester.cs
===================================================================
--- trunk/Source/StructureMap.Testing/Configuration/ConfigurationParserBuilderTester.cs 2008-06-15 01:49:31 UTC (rev 121)
+++ trunk/Source/StructureMap.Testing/Configuration/ConfigurationParserBuilderTester.cs 2008-06-15 14:28:14 UTC (rev 122)
@@ -131,14 +131,6 @@
});
}
- // TODO: Decide if this is important or not
- //[Test]
- //public void Log_error_156_if_Include_node_does_not_have_a_File()
- //{
- // DataMother.WriteDocument("MissingInclude.xml", "<StructureMap><Include></Include></StructureMap>");
- // assertErrorIsLogged(156, () => builder.IncludeFile("MissingInclude.xml"));
- //}
-
[Test, Explicit]
public void Log_exception_100_if_StructureMap_config_is_required_and_missing()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|