From e72eafb43c0e6eb547c9b3214fe0c0e76161179c Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Fri, 28 Apr 2017 12:21:35 +0200 Subject: [PATCH] ensure itemTemplate instantiator has a unique id per path+dataType+data --- src/Instantiator.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Instantiator.cs b/src/Instantiator.cs index afef6982..4c236cd4 100644 --- a/src/Instantiator.cs +++ b/src/Instantiator.cs @@ -41,7 +41,12 @@ namespace Crow public delegate object InstanciatorInvoker(Interface iface); /// - /// Instantiator + /// Reflexion being very slow, the settings of the starting values for widgets are set by a dynamic method. + /// This method is created on the first instacing and is recalled for further widget instancing. + /// It include + /// - XML values setting + /// - Default values (appearing as attribute in C#) loading + /// - Stiling /// public class Instantiator { @@ -205,8 +210,9 @@ namespace Crow } else { if (!reader.IsEmptyElement) throw new Exception ("ItemTemplate with Path attribute may not include sub nodes"); - itemTmpID = path; - Interface.Instantiators [itemTmpID] = + itemTmpID = path+dataType+datas; + if (!Interface.Instantiators.ContainsKey (itemTmpID)) + Interface.Instantiators [itemTmpID] = new ItemTemplate (Interface.GetStreamFromPath (itemTmpID), dataType, datas); } itemTemplateIds.Add (new string [] { dataType, itemTmpID, datas }); -- 2.47.3