aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/IMLReader.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-08-12 17:17:05 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-08-12 17:17:05 +0200
commit86acbb4902a25100a183da7ce9e7a5662de8b4cb (patch)
tree6fb2b3897704267d3fdb5b260df51b29135577f2 /src/IMLReader.cs
parented815a31113235890cf6c902c754fb3dc7536708 (diff)
default template searched in embedded resources with .template extension
Diffstat (limited to 'src/IMLReader.cs')
-rw-r--r--src/IMLReader.cs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/IMLReader.cs b/src/IMLReader.cs
index f8fd34ed..78f1880a 100644
--- a/src/IMLReader.cs
+++ b/src/IMLReader.cs
@@ -147,21 +147,16 @@ namespace Crow
}
if (!inlineTemplate) {
+ reader.il.Emit (OpCodes.Ldloc_0);//Load this templateControl ref
if (string.IsNullOrEmpty (templatePath)) {
- DefaultTemplate dt = (DefaultTemplate)crowType.GetCustomAttributes (typeof(DefaultTemplate), true).FirstOrDefault ();
- if (dt!=null)
- templatePath = dt.Path;
- }
-
- if (!string.IsNullOrEmpty (templatePath)) {
- reader.il.Emit (OpCodes.Ldloc_0);//Load this templateControl ref
-
+ reader.il.Emit (OpCodes.Ldnull);//default template loading
+ }else{
reader.il.Emit (OpCodes.Ldstr, templatePath); //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
- crowType.GetMethod ("loadTemplate", BindingFlags.Instance | BindingFlags.NonPublic));
+ typeof(Interface).GetMethod ("Load", BindingFlags.Static | BindingFlags.Public));
}
+ reader.il.Emit (OpCodes.Callvirt,//load template
+ crowType.GetMethod ("loadTemplate", BindingFlags.Instance | BindingFlags.NonPublic));
}
foreach (string[] iTempId in itemTemplateIds) {
reader.il.Emit (OpCodes.Ldloc_0);//load TempControl ref