Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
            private Request _getNewRequest(RadElement e)
            {
                Request request1;

                if (this._pocket != null)
                {
                    Request request2;
                    request1     = this._pocket;
                    this._pocket = request1.Next;
                    this._pocketSize--;
                    request1.Prev = (Request)(request2 = null);
                    request1.Next = request2;
                }
                else
                {
                    ContextLayoutManager manager1 = e.LayoutManager as ContextLayoutManager;
                    try
                    {
                        request1 = new Request();
                    }
                    catch (OutOfMemoryException exception1)
                    {
                        if (manager1 != null)
                        {
                            manager1.setForceLayout(e);
                        }
                        throw exception1;
                    }
                }
                request1.Target = e;
                return(request1);
            }
Ejemplo n.º 3
0
        private static void UpdateLayoutCallback(ILayoutManager manager)
        {
            ContextLayoutManager layoutManager = manager as ContextLayoutManager;

            if (layoutManager != null && !layoutManager._isDead)
            {
                layoutManager.UpdateLayout();
            }
        }
Ejemplo n.º 4
0
        private static void UpdateLayoutBackground(ILayoutManager manager)
        {
            ContextLayoutManager layoutManager = manager as ContextLayoutManager;

            if (layoutManager != null)
            {
                layoutManager.NeedsRecalc();
            }
        }
Ejemplo n.º 5
0
        private static void UpdateLayoutCallback(ILayoutManager manager)
        {
            ContextLayoutManager contextLayoutManager = manager as ContextLayoutManager;

            if (contextLayoutManager == null || contextLayoutManager._isDead)
            {
                return;
            }
            contextLayoutManager.UpdateLayout();
        }
Ejemplo n.º 6
0
            public void Add(RadElement e)
            {
                if (this.getRequest(e) != null || e.IsLayoutSuspended)
                {
                    return;
                }
                this.RemoveOrphans(e);
                RadElement parent1 = e.Parent;

                if (parent1 != null && this.canRelyOnParentRecalc(parent1))
                {
                    return;
                }
                ContextLayoutManager layoutManager = e.LayoutManager as ContextLayoutManager;

                if (layoutManager._isDead)
                {
                    return;
                }
                RadElement parent2;

                if (this._pocketSize <= 8)
                {
                    for (; e != null; e = parent2)
                    {
                        parent2 = e.Parent;
                        this.invalidate(e);
                        if (parent2 != null)
                        {
                            this.Remove(e);
                        }
                        else if (this.getRequest(e) == null)
                        {
                            this.RemoveOrphans(e);
                            this._addRequest(e);
                        }
                    }
                }
                else
                {
                    this._addRequest(e);
                }
                layoutManager.NeedsRecalc();
            }
Ejemplo n.º 7
0
            //public bool Contains(RadElement e)
            //{
            //    Request request = this._head;
            //    while (request != null)
            //    {
            //        if (object.ReferenceEquals(request.Target, e))
            //            return true;
            //        request = request.Next;
            //    }
            //    return false;
            //}

            public void Add(RadElement e)
            {
                if ((this.getRequest(e) == null) && !e.IsLayoutSuspended)
                {
                    this.RemoveOrphans(e);
                    RadElement element2 = e.Parent;
                    if ((element2 == null) || !this.canRelyOnParentRecalc(element2))
                    {
                        ContextLayoutManager manager1 = e.LayoutManager as ContextLayoutManager;
                        if (!manager1._isDead)
                        {
                            if (this._pocketSize <= PocketReserve)
                            {
                                while (e != null)
                                {
                                    RadElement element1 = e.Parent;
                                    this.invalidate(e);
                                    if (element1 != null)
                                    {
                                        this.Remove(e);
                                    }
                                    else if (this.getRequest(e) == null)
                                    {
                                        this.RemoveOrphans(e);
                                        this._addRequest(e);
                                    }
                                    e = element1;
                                }
                            }
                            else
                            {
                                this._addRequest(e);
                            }
                            manager1.NeedsRecalc();
                        }
                    }
                }
            }