private ContextLayoutManager.LayoutQueue.Request _getNewRequest( RadElement e) { ContextLayoutManager.LayoutQueue.Request request1; if (this._pocket != null) { request1 = this._pocket; this._pocket = request1.Next; --this._pocketSize; ContextLayoutManager.LayoutQueue.Request request2; request1.Prev = request2 = (ContextLayoutManager.LayoutQueue.Request)null; request1.Next = request2; } else { ContextLayoutManager layoutManager = e.LayoutManager as ContextLayoutManager; try { request1 = new ContextLayoutManager.LayoutQueue.Request(); } catch (OutOfMemoryException ex) { layoutManager?.setForceLayout(e); throw ex; } } request1.Target = e; return(request1); }
public void Remove(RadElement e) { ContextLayoutManager.LayoutQueue.Request request = this.getRequest(e); if (request == null) { return; } this._removeRequest(request); this.setRequest(e, (ContextLayoutManager.LayoutQueue.Request)null); }
private void ReuseRequest(ContextLayoutManager.LayoutQueue.Request r) { r.Target = (RadElement)null; if (this._pocketSize >= 153) { return; } r.Next = this._pocket; this._pocket = r; ++this._pocketSize; }
internal LayoutQueue() { for (int index = 0; index < 153; ++index) { this._pocket = new ContextLayoutManager.LayoutQueue.Request() { Next = this._pocket } } ; this._pocketSize = 153; }
internal void RemoveOrphans(RadElement parent) { ContextLayoutManager.LayoutQueue.Request next; for (ContextLayoutManager.LayoutQueue.Request request = this._head; request != null; request = next) { RadElement target = request.Target; next = request.Next; ulong treeLevel = (ulong)parent.TreeLevel; if ((long)target.TreeLevel == (long)treeLevel + 1L && target.Parent == parent) { this._removeRequest(this.getRequest(target)); this.setRequest(target, (ContextLayoutManager.LayoutQueue.Request)null); } } }
private void _addRequest(RadElement e) { ContextLayoutManager.LayoutQueue.Request newRequest = this._getNewRequest(e); if (newRequest == null) { return; } newRequest.Next = this._head; if (this._head != null) { this._head.Prev = newRequest; } this._head = newRequest; this.setRequest(e, newRequest); }
internal RadElement GetTopMost() { RadElement radElement = (RadElement)null; ulong num = ulong.MaxValue; for (ContextLayoutManager.LayoutQueue.Request request = this._head; request != null; request = request.Next) { ulong treeLevel = (ulong)request.Target.TreeLevel; if (treeLevel < num) { num = treeLevel; radElement = request.Target; } } return(radElement); }
private void _removeRequest(ContextLayoutManager.LayoutQueue.Request entry) { if (entry.Prev == null) { this._head = entry.Next; } else { entry.Prev.Next = entry.Next; } if (entry.Next != null) { entry.Next.Prev = entry.Prev; } this.ReuseRequest(entry); }
internal override void setRequest(RadElement e, ContextLayoutManager.LayoutQueue.Request r) { e.MeasureRequest = r; }
internal abstract void setRequest(RadElement e, ContextLayoutManager.LayoutQueue.Request r);