diff options
Diffstat (limited to 'src/CompilerServices/CompilerServices.cs')
| -rw-r--r-- | src/CompilerServices/CompilerServices.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs index 80b4d535..da15dbf5 100644 --- a/src/CompilerServices/CompilerServices.cs +++ b/src/CompilerServices/CompilerServices.cs @@ -51,11 +51,9 @@ namespace Crow reader.il.Emit (OpCodes.Ldstr, template); //Load template path string reader.il.Emit (OpCodes.Callvirt,//call Interface.Load(path) typeof(Interface).GetMethod ("Load", BindingFlags.Static | BindingFlags.Public)); - reader.il.Emit (OpCodes.Callvirt,//add child - typeof(PrivateContainer).GetMethod ("SetChild", BindingFlags.Instance | BindingFlags.NonPublic)); } - reader.il.Emit (OpCodes.Ldloc_0); - reader.il.Emit (OpCodes.Callvirt, crowType.GetMethod ("ResolveBindings")); + reader.il.Emit (OpCodes.Callvirt,//add child + typeof(TemplatedControl).GetMethod ("loadTemplate", BindingFlags.Instance | BindingFlags.NonPublic)); } } @@ -124,6 +122,11 @@ namespace Crow break; case XmlNodeType.Element: //Templates + if (reader.Name == "Template" || + reader.Name == "ItemTemplate") { + reader.Skip (); + continue; + } if (miAddChild == null) { @@ -131,6 +134,8 @@ namespace Crow miAddChild = typeof(Group).GetMethod ("AddChild"); else if (typeof(Container).IsAssignableFrom (crowType)) miAddChild = typeof(Container).GetMethod ("SetChild"); + else if (typeof(TemplatedContainer).IsAssignableFrom (crowType)) + miAddChild = typeof(TemplatedContainer).GetProperty("Content").GetSetMethod(); else if (typeof(PrivateContainer).IsAssignableFrom (crowType)) miAddChild = typeof(PrivateContainer).GetMethod ("SetChild", BindingFlags.Instance | BindingFlags.NonPublic); |