diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-04 19:48:05 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-04 20:06:58 +0200 |
| commit | b58c6b328c06784d31765b29b574bed17082be27 (patch) | |
| tree | 03df05738a0d8d0f07db24f8768bdf321710f40a /src/LayoutingQueueItem.cs | |
| parent | e2d351c9de4ee9c8b04376228f3ab5b9310392c9 (diff) | |
Layouting DiscardQueue with MaxDiscardCount
modifié : src/Interface.cs
modifié : src/LayoutingQueueItem.cs
modifié : src/GraphicObjects/ListBox.cs
Diffstat (limited to 'src/LayoutingQueueItem.cs')
| -rw-r--r-- | src/LayoutingQueueItem.cs | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index 8ffb7dbf..f35eb78d 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -46,7 +46,7 @@ namespace Crow /// <summary> Bitfield containing the element of the layout to performs (x|y|width|height)</summary> public LayoutingType LayoutType; /// <summary> Unsuccessfull UpdateLayout and requeueing count </summary> - public int LayoutingTries; + public int LayoutingTries, DiscardCount; #region CTOR public LayoutingQueueItem (LayoutingType _layoutType, ILayoutable _graphicObject) @@ -70,16 +70,30 @@ namespace Crow Debug.WriteLine ("Layouting => " + this.ToString ()); #endif if (!GraphicObject.UpdateLayout (LayoutType)) { - #if DEBUG_LAYOUTING - Debug.WriteLine ("\tRequeuing => " + this.ToString ()); - #endif - LayoutingTries ++; if (LayoutingTries < Interface.MaxLayoutingTries) { + #if DEBUG_LAYOUTING + Debug.WriteLine ("\tRequeuing => " + this.ToString ()); + #endif + LayoutingTries++; GraphicObject.RegisteredLayoutings |= LayoutType; Interface.CurrentInterface.LayoutingQueue.Enqueue (this); + } else if (DiscardCount < Interface.MaxDiscardCount) { + #if DEBUG_LAYOUTING + Debug.WriteLine ("\tDiscarding => " + this.ToString ()); + #endif + LayoutingTries = 0; + DiscardCount++; + GraphicObject.RegisteredLayoutings |= LayoutType; + Interface.CurrentInterface.DiscardQueue.Enqueue (this); } - } else + //#if DEBUG_LAYOUTING + else + Debug.WriteLine ("\tDELETED => " + this.ToString ()); + //#endif + } else { + DiscardCount = 0; LayoutingTries = 0; + } } public static implicit operator GraphicObject(LayoutingQueueItem queueItem) |