|
From: <jer...@us...> - 2009-12-26 05:32:40
|
Revision: 287
http://structuremap.svn.sourceforge.net/structuremap/?rev=287&view=rev
Author: jeremydmiller
Date: 2009-12-26 05:32:30 +0000 (Sat, 26 Dec 2009)
Log Message:
-----------
The big, big, big switch from IL generation to dynamic Func's. Ding dong, the witch is dead.
Modified Paths:
--------------
trunk/Source/StructureMap.Testing.Widget/ArrayConstruction.cs
trunk/Source/StructureMap.Testing.Widget/BuilderSamples.cs
trunk/Source/StructureMap.Testing.Widget/Decision.cs
trunk/Source/StructureMap.Testing.Widget/Hierarchy.cs
trunk/Source/StructureMap.Testing.Widget/Rule.cs
Modified: trunk/Source/StructureMap.Testing.Widget/ArrayConstruction.cs
===================================================================
--- trunk/Source/StructureMap.Testing.Widget/ArrayConstruction.cs 2009-12-26 05:32:08 UTC (rev 286)
+++ trunk/Source/StructureMap.Testing.Widget/ArrayConstruction.cs 2009-12-26 05:32:30 UTC (rev 287)
@@ -48,18 +48,4 @@
#endregion
}
-
- public class StringListBuilder : InstanceBuilder
- {
- public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
- {
- return null;
- }
-
-
- public override Type PluggedType
- {
- get { return null; }
- }
- }
}
\ No newline at end of file
Modified: trunk/Source/StructureMap.Testing.Widget/BuilderSamples.cs
===================================================================
--- trunk/Source/StructureMap.Testing.Widget/BuilderSamples.cs 2009-12-26 05:32:08 UTC (rev 286)
+++ trunk/Source/StructureMap.Testing.Widget/BuilderSamples.cs 2009-12-26 05:32:30 UTC (rev 287)
@@ -21,55 +21,43 @@
public Color Color { get; set; }
}
- public class BuilderWithNoSetters : InstanceBuilder
- {
- public override Type PluggedType
- {
- get { throw new System.NotImplementedException(); }
- }
- public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
- {
- SetterTarget target = new SetterTarget();
- return target;
- }
- }
- public class BuilderWithOneSetter : InstanceBuilder
- {
- public override Type PluggedType
- {
- get { throw new System.NotImplementedException(); }
- }
+ //public class BuilderWithOneSetter : InstanceBuilder
+ //{
+ // public override Type PluggedType
+ // {
+ // get { throw new System.NotImplementedException(); }
+ // }
- public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
- {
- SetterTarget target = new SetterTarget();
- if (instance.HasProperty("Name")) target.Name = instance.GetProperty("Name");
- return target;
- }
- }
+ // public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
+ // {
+ // SetterTarget target = new SetterTarget();
+ // if (instance.HasProperty("Name", null)) target.Name = instance.GetProperty("Name");
+ // return target;
+ // }
+ //}
- public class BuilderWithTwoSetters : InstanceBuilder
- {
- public override Type PluggedType
- {
- get { throw new System.NotImplementedException(); }
- }
+ //public class BuilderWithTwoSetters : InstanceBuilder
+ //{
+ // public override Type PluggedType
+ // {
+ // get { throw new System.NotImplementedException(); }
+ // }
- public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
- {
- SetterTarget target = new SetterTarget();
- if (instance.HasProperty("Name")) target.Name = instance.GetProperty("Name");
- if (instance.HasProperty("Name2")) target.Name = instance.GetProperty("Name2");
- return target;
- }
+ // public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
+ // {
+ // SetterTarget target = new SetterTarget();
+ // if (instance.HasProperty("Name", null)) target.Name = instance.GetProperty("Name");
+ // if (instance.HasProperty("Name2", null)) target.Name = instance.GetProperty("Name2");
+ // return target;
+ // }
- public override void BuildUp(IConfiguredInstance instance, BuildSession session, object target)
- {
- SetterTarget x = (SetterTarget) target;
- if (instance.HasProperty("Name")) x.Name = instance.GetProperty("Name");
- if (instance.HasProperty("Name2")) x.Name = instance.GetProperty("Name2");
- }
- }
+ // public override void BuildUp(IConfiguredInstance instance, BuildSession session, object target)
+ // {
+ // SetterTarget x = (SetterTarget) target;
+ // if (instance.HasProperty("Name", null)) x.Name = instance.GetProperty("Name");
+ // if (instance.HasProperty("Name2", null)) x.Name = instance.GetProperty("Name2");
+ // }
+ //}
}
Modified: trunk/Source/StructureMap.Testing.Widget/Decision.cs
===================================================================
--- trunk/Source/StructureMap.Testing.Widget/Decision.cs 2009-12-26 05:32:08 UTC (rev 286)
+++ trunk/Source/StructureMap.Testing.Widget/Decision.cs 2009-12-26 05:32:30 UTC (rev 287)
@@ -14,19 +14,4 @@
}
}
-
- public class DecisionBuilder : InstanceBuilder
- {
- public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
- {
- return new Decision(
- (Rule[]) session.CreateInstanceArray(typeof(Rule), instance.GetChildrenArray("Rules")));
- }
-
-
- public override Type PluggedType
- {
- get { return typeof (Decision); }
- }
- }
}
\ No newline at end of file
Modified: trunk/Source/StructureMap.Testing.Widget/Hierarchy.cs
===================================================================
--- trunk/Source/StructureMap.Testing.Widget/Hierarchy.cs 2009-12-26 05:32:08 UTC (rev 286)
+++ trunk/Source/StructureMap.Testing.Widget/Hierarchy.cs 2009-12-26 05:32:30 UTC (rev 287)
@@ -89,21 +89,4 @@
}
}
-
- public class ChildLoaderTemplate : InstanceBuilder
- {
- public override Type PluggedType
- {
- get { throw new NotImplementedException(); }
- }
-
-
- public override object BuildInstance(IConfiguredInstance instance, BuildSession session)
- {
- var target = new Child(
- instance.GetProperty("Name"),
- (GrandChild) instance.Get("MyGrandChild", typeof(GrandChild), session));
- return target;
- }
- }
}
\ No newline at end of file
Modified: trunk/Source/StructureMap.Testing.Widget/Rule.cs
===================================================================
--- trunk/Source/StructureMap.Testing.Widget/Rule.cs 2009-12-26 05:32:08 UTC (rev 286)
+++ trunk/Source/StructureMap.Testing.Widget/Rule.cs 2009-12-26 05:32:30 UTC (rev 287)
@@ -94,13 +94,13 @@
IConfiguredInstance instance = memento;
- instance.SetProperty("String", "Red");
- instance.SetProperty("String2", "Green");
- instance.SetProperty("Int", "1");
- instance.SetProperty("Long", "2");
- instance.SetProperty("Byte", "3");
- instance.SetProperty("Double", "4");
- instance.SetProperty("Bool", "true");
+ instance.SetValue("String", "Red");
+ instance.SetValue("String2", "Green");
+ instance.SetValue("Int", "1");
+ instance.SetValue("Long", "2");
+ instance.SetValue("Byte", "3");
+ instance.SetValue("Double", "4");
+ instance.SetValue("Bool", "true");
return memento;
}
@@ -118,6 +118,8 @@
_Color = color;
}
+ public string Name { get; set; }
+ public int Age { get; set; }
public string Color
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|