From: Jean-Philippe Bruyère Date: Fri, 2 Mar 2018 06:53:54 +0000 (+0100) Subject: CrowIDE wip, removed key repeat already handled by otk X-Git-Tag: v0.9.5-beta~153^2~30 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=5bcd45c3ccc34edc68188a3acdb09e742b21aef3;p=jp%2Fcrow.git CrowIDE wip, removed key repeat already handled by otk --- 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