diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-09-13 14:44:26 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-09-13 14:44:26 +0200 |
| commit | 2616e6ee7a1a34036cc002d28543d0d7a657fdb2 (patch) | |
| tree | e48dacb4209e95cb963de76cb6fe1ffca07e77c1 /src/LayoutingQueueItem.cs | |
| parent | b7786bbd327699b0a8dd30d5ca86fc20f28f5617 (diff) | |
Merge improvements from CrowIDE
modifié : Templates/DirectoryView.template
modifié : Templates/Menu.template
modifié : Templates/MenuItem.template
modifié : Templates/Window.template
modifié : Tests/Interfaces/Divers/0.crow
modifié : src/CompilerServices/CompilerServices.cs
modifié : src/ExtensionsMethods.cs
modifié : src/GraphicObjects/DirectoryView.cs
modifié : src/GraphicObjects/GraphicObject.cs
modifié : src/GraphicObjects/Group.cs
modifié : src/GraphicObjects/TreeView.cs
modifié : src/GraphicObjects/Wrapper.cs
modifié : src/IMLReader.cs
modifié : src/Interface.cs
modifié : src/ItemTemplate.cs
modifié : src/LayoutingQueueItem.cs
modifié : src/Measure.cs
modifié : src/Point.cs
Diffstat (limited to 'src/LayoutingQueueItem.cs')
| -rw-r--r-- | src/LayoutingQueueItem.cs | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index 6de5be7b..3b19efc9 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -51,17 +51,25 @@ namespace Crow public int LayoutingTries, DiscardCount; #if DEBUG_LAYOUTING - public static List<LayoutingQueueItem> processedLQIs = new List<LayoutingQueueItem>(); - public static LayoutingQueueItem[] MultipleRunsLQIs { - get { return processedLQIs.Where(l=>l.LayoutingTries>2 || l.DiscardCount > 0).ToArray(); } - } - public static LayoutingQueueItem currentLQI = null; public Stopwatch LQITime = new Stopwatch(); - public List<LayoutingQueueItem> triggeredLQIs = new List<LayoutingQueueItem>(); + public LQIList triggeredLQIs = new LQIList(); public LayoutingQueueItem wasTriggeredBy = null; public GraphicObject graphicObject { get { return Layoutable as GraphicObject; } } + public string Name { + get { return graphicObject.Name; } + } + public string FullName { + get { return graphicObject.ToString(); } + } + public Measure Width { + get { return graphicObject.Width; } + } + public Measure Height { + get { return graphicObject.Height; } + } + public bool HasTriggeredLQIs { get { return triggeredLQIs.Count > 0; }} public Rectangle Slot, NewSlot; #endif @@ -72,12 +80,11 @@ namespace Crow Layoutable = _graphicObject; Layoutable.RegisteredLayoutings |= LayoutType; #if DEBUG_LAYOUTING - if (graphicObject.CurrentDrawLQIs == null) - graphicObject.CurrentDrawLQIs = new List<LayoutingQueueItem>(); - graphicObject.CurrentDrawLQIs.Add(this); - if (currentLQI != null){ - wasTriggeredBy = currentLQI; - currentLQI.triggeredLQIs.Add(this); + GraphicObject g = graphicObject; + g.CurrentInterface.curLQIs.Add(this); + if (g.CurrentInterface.currentLQI != null){ + wasTriggeredBy = g.CurrentInterface.currentLQI; + g.CurrentInterface.currentLQI.triggeredLQIs.Add(this); } #endif } @@ -93,13 +100,11 @@ namespace Crow return; } #if DEBUG_LAYOUTING - currentLQI = this; - processedLQIs.Add(this); LQITime.Start(); #endif + LayoutingTries++; if (!Layoutable.UpdateLayout (LayoutType)) { if (LayoutingTries < Interface.MaxLayoutingTries) { - LayoutingTries++; Layoutable.RegisteredLayoutings |= LayoutType; (Layoutable as GraphicObject).CurrentInterface.LayoutingQueue.Enqueue (this); } else if (DiscardCount < Interface.MaxDiscardCount) { @@ -114,7 +119,6 @@ namespace Crow #endif } #if DEBUG_LAYOUTING - currentLQI = null; LQITime.Stop(); #endif } @@ -138,5 +142,12 @@ namespace Crow #endif } } + public class LQIList : List<LayoutingQueueItem>{ + #if DEBUG_LAYOUTING + public List<LayoutingQueueItem> GetRootLQIs(){ + return this.Where (lqi => lqi.wasTriggeredBy == null).ToList (); + } + #endif + } } |