Ejemplo n.º 1
0
        public void UpdateLayout()
        {
            if (this._isInUpdateLayout || this._measuresOnStack > 0 || (this._arrangesOnStack > 0 || this._isDead))
            {
                return;
            }
            int        num1       = 0;
            bool       flag       = true;
            RadElement radElement = (RadElement)null;

            try
            {
                this.invalidateTreeIfRecovering();
                while (this.hasDirtiness || this._firePostLayoutEvents)
                {
                    if (++num1 > 153)
                    {
                        this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                        radElement = (RadElement)null;
                        flag       = false;
                        return;
                    }
                    this._isUpdating       = true;
                    this._isInUpdateLayout = true;
                    int      num2     = 0;
                    DateTime dateTime = new DateTime(0L);
                    do
                    {
                        if (++num2 > 153)
                        {
                            num2 = 0;
                            if (dateTime.Ticks == 0L)
                            {
                                dateTime = DateTime.Now;
                            }
                            else if ((DateTime.Now - dateTime).Milliseconds > 306)
                            {
                                this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                                radElement = (RadElement)null;
                                flag       = false;
                                return;
                            }
                        }
                        radElement = this.MeasureQueueInternal.GetTopMost();
                        radElement?.Measure(radElement.PreviousConstraint);
                    }while (radElement != null);
                    int num3 = 0;
                    dateTime = new DateTime(0L);
                    while (this.MeasureQueueInternal.IsEmpty)
                    {
                        if (++num3 > 153)
                        {
                            num3 = 0;
                            if (dateTime.Ticks == 0L)
                            {
                                dateTime = DateTime.Now;
                            }
                            else if ((DateTime.Now - dateTime).Milliseconds > 306)
                            {
                                this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                                radElement = (RadElement)null;
                                flag       = false;
                                return;
                            }
                        }
                        radElement = this.ArrangeQueueInternal.GetTopMost();
                        if (radElement != null)
                        {
                            RectangleF arrangeRect = radElement.GetArrangeRect(radElement.PreviousArrangeRect);
                            radElement.Arrange(arrangeRect);
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (this.MeasureQueueInternal.IsEmpty)
                    {
                        this._isInUpdateLayout = false;
                        this.fireSizeChangedEvents();
                        if (!this.hasDirtiness)
                        {
                            this.fireLayoutUpdateEvent();
                        }
                    }
                }
                radElement = (RadElement)null;
                flag       = false;
            }
            finally
            {
                this._isUpdating          = false;
                this._layoutRequestPosted = false;
                this._isInUpdateLayout    = false;
                if (flag)
                {
                    this._gotException       = true;
                    this._forceLayoutElement = radElement;
                    this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                }
            }
        }
Ejemplo n.º 2
0
        public void UpdateLayout()
        {
            if ((!this._isInUpdateLayout && (this._measuresOnStack <= 0)) && ((this._arrangesOnStack <= 0) && !this._isDead))
            {
                int        num2     = 0;
                bool       flag1    = true;
                RadElement element1 = null;
                try
                {
                    this.invalidateTreeIfRecovering();
                    while (this.hasDirtiness || this._firePostLayoutEvents)
                    {
                        if (++num2 > LayoutQueue.PocketCapacity)
                        {
                            this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                            element1 = null;
                            flag1    = false;
                            return;
                        }
                        this._isUpdating       = true;
                        this._isInUpdateLayout = true;

                        int      num1  = 0;
                        DateTime time1 = new DateTime(0L);
                        do
                        {
                            if (++num1 > LayoutQueue.PocketCapacity)
                            {
                                num1 = 0;
                                if (time1.Ticks == 0)
                                {
                                    time1 = DateTime.Now;
                                }
                                else
                                {
                                    TimeSpan span2 = (TimeSpan)(DateTime.Now - time1);
                                    if (span2.Milliseconds > 0x132)
                                    {
                                        this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                                        element1 = null;
                                        flag1    = false;
                                        return;
                                    }
                                }
                            }
                            element1 = this.MeasureQueueInternal.GetTopMost();
                            if (element1 != null)
                            {
                                element1.Measure(element1.PreviousConstraint);
                            }
                        }while (element1 != null);

                        num1  = 0;
                        time1 = new DateTime((long)0);
                        while (this.MeasureQueueInternal.IsEmpty)
                        {
                            if (++num1 > LayoutQueue.PocketCapacity)
                            {
                                num1 = 0;
                                if (time1.Ticks == 0)
                                {
                                    time1 = DateTime.Now;
                                }
                                else
                                {
                                    TimeSpan span1 = (TimeSpan)(DateTime.Now - time1);
                                    if (span1.Milliseconds > 0x132)
                                    {
                                        this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                                        element1 = null;
                                        flag1    = false;
                                        return;
                                    }
                                }
                            }
                            element1 = this.ArrangeQueueInternal.GetTopMost();
                            if (element1 == null)
                            {
                                break;
                            }
                            RectangleF rect1 = element1.GetArrangeRect(element1.PreviousArrangeRect);
                            element1.Arrange(rect1);
                        }
                        if (!this.MeasureQueueInternal.IsEmpty)
                        {
                            continue;
                        }
                        this._isInUpdateLayout = false;

                        this.fireSizeChangedEvents();
                        if (!this.hasDirtiness)
                        {
                            this.fireLayoutUpdateEvent();
                        }
                    }
                    element1 = null;
                    flag1    = false;
                }
                finally
                {
                    this._isUpdating          = false;
                    this._layoutRequestPosted = false;
                    this._isInUpdateLayout    = false;
                    if (flag1)
                    {
                        this._gotException       = true;
                        this._forceLayoutElement = element1;
                        this.InvokeAsyncCallback(ContextLayoutManager._updateLayoutBackground);
                    }
                }
            }
        }