From 5bcd45c3ccc34edc68188a3acdb09e742b21aef3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 2 Mar 2018 07:53:54 +0100 Subject: [PATCH] CrowIDE wip, removed key repeat already handled by otk --- src/Configuration.cs | 3 +- src/GraphicObjects/GraphicObject.cs | 117 ++++++++++++++------------- src/GraphicObjects/TemplatedGroup.cs | 2 +- src/Interface.cs | 26 +++--- src/ParsingException.cs | 8 +- src/Style.cs | 21 ++++- src/StyleReader.cs | 32 ++++---- 7 files changed, 109 insertions(+), 100 deletions(-) diff --git a/src/Configuration.cs b/src/Configuration.cs index a6b0f0b0..a6328c0a 100644 --- a/src/Configuration.cs +++ b/src/Configuration.cs @@ -169,7 +169,8 @@ namespace Crow using (StreamWriter sw = new StreamWriter (s)) { lock (items) { foreach (string key in items.Keys) { - sw.WriteLine (key + "=" + (string)items [key].curVal.ToString ()); + if (items [key].curVal != null) + sw.WriteLine (key + "=" + (string)items [key].curVal.ToString ()); } } } diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index f5a1a224..adb29e54 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -52,12 +52,22 @@ namespace Crow internal ReaderWriterLockSlim parentRWLock = new ReaderWriterLockSlim(); #if DESIGN_MODE + static MethodInfo miDesignAddDefLoc = typeof(GraphicObject).GetMethod("design_add_default_location", + BindingFlags.Instance | BindingFlags.NonPublic); public volatile bool HasChanged = false; public string design_id; public int design_line; public int design_column; public string design_imlPath; public Dictionary design_members = new Dictionary(); + public Dictionary design_defaults = new Dictionary(); + internal void design_add_default_location (string memberName, string path, int line, int col) { + if (design_defaults.ContainsKey(memberName)){ + Console.WriteLine ("default value localtion already set for {0}{1}.{2}", this.GetType().Name, this.design_id, memberName); + return; + } + design_defaults.Add(memberName, new FileLocation(path,line,col)); + } public bool design_isTGItem = false; public virtual bool FindByDesignID(string designID, out GraphicObject go){ @@ -932,16 +942,12 @@ namespace Crow IFace.DefaultValuesLoader [Style] (this); return; } - } else { - if (IFace.DefaultValuesLoader.ContainsKey (thisType.FullName)) { - IFace.DefaultValuesLoader [thisType.FullName] (this); - return; - } else if (!IFace.Styling.ContainsKey (thisType.FullName)) { - if (IFace.DefaultValuesLoader.ContainsKey (thisType.Name)) { - IFace.DefaultValuesLoader [thisType.Name] (this); - return; - } - } + } else if (IFace.DefaultValuesLoader.ContainsKey (thisType.FullName)) { + IFace.DefaultValuesLoader [thisType.FullName] (this); + return; + } else if (IFace.DefaultValuesLoader.ContainsKey (thisType.Name)) { + IFace.DefaultValuesLoader [thisType.Name] (this); + return; } List