aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-04-28 12:21:35 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2017-04-28 12:21:35 +0200
commit1dfa383f7faf8a5a161ed248c75f78e2faefe334 (patch)
treec9b4cf34681b4c85c94b6dafdb0d4cada3fed959 /src
parent7d1927cd5988f8ef75589c333d929ee732711108 (diff)
ensure itemTemplate instantiator has a unique id per path+dataType+data
Diffstat (limited to 'src')
-rw-r--r--src/Instantiator.cs12
1 files 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);
/// <summary>
- /// 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
/// </summary>
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 });