Exemplo n.º 1
0
        // Just forwards to xLayoutRow.  This will layout elements from the start index to the end index.  RowBounds
        // was computed by a call to measure row and is used for alignment/boxstretch.  See the ElementProxy class
        // for an explaination of the elementProxy parameter.
        private void LayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds)
        {
            int  dummy;
            Size outSize = xLayoutRow(containerProxy, elementProxy, startIndex, endIndex, rowBounds, /* breakIndex = */ out dummy, /* measureOnly = */ false);

            Debug.Assert(dummy == endIndex, "EndIndex / BreakIndex mismatch.");
        }
Exemplo n.º 2
0
        private Size xLayout(Control container, Rectangle displayRect, bool measureOnly)
        {
            int            num2;
            FlowDirection  flowDirection  = GetFlowDirection(container);
            bool           wrapContents   = GetWrapContents(container);
            ContainerProxy containerProxy = CreateContainerProxy(container, flowDirection);

            containerProxy.DisplayRect = displayRect;
            displayRect = containerProxy.DisplayRect;
            ElementProxy elementProxy = containerProxy.ElementProxy;
            Size         empty        = Size.Empty;

            if (!wrapContents)
            {
                displayRect.Width = 0x7fffffff - displayRect.X;
            }
            for (int i = 0; i < container.Children.Count; i = num2)
            {
                Size      size2            = Size.Empty;
                Rectangle displayRectangle = new Rectangle(displayRect.X, displayRect.Y, displayRect.Width, displayRect.Height - empty.Height);
                size2 = this.MeasureRow(containerProxy, elementProxy, i, displayRectangle, out num2);
                if (!measureOnly)
                {
                    Rectangle rowBounds = new Rectangle(displayRect.X, empty.Height + displayRect.Y, size2.Width, size2.Height);
                    this.LayoutRow(containerProxy, elementProxy, i, num2, rowBounds);
                }
                empty.Width   = Math.Max(empty.Width, size2.Width);
                empty.Height += size2.Height;
            }
            if (container.Children.Count != 0)
            {
            }
            return(LayoutUtils.FlipSizeIf((flowDirection == FlowDirection.TopDown) || (GetFlowDirection(container) == FlowDirection.BottomUp), empty));
        }
Exemplo n.º 3
0
        /// <summary>
        ///  Both LayoutCore and GetPreferredSize forward to this method.
        ///  The measureOnly flag determines which behavior we get.
        /// </summary>
        private Size TryCalculatePreferredSize(IArrangedElement container, Rectangle displayRect, bool measureOnly)
        {
            FlowDirection flowDirection = GetFlowDirection(container);
            bool          wrapContents  = GetWrapContents(container);

            ContainerProxy containerProxy = CreateContainerProxy(container, flowDirection);

            containerProxy.DisplayRect = displayRect;

            // refetch as it's now adjusted for Vertical.
            displayRect = containerProxy.DisplayRect;

            ElementProxy elementProxy = containerProxy.ElementProxy;
            Size         layoutSize   = Size.Empty;

            if (!wrapContents)
            {
                // pretend that the container is infinitely wide to prevent wrapping.
                // DisplayRectangle.Right is Width + X - subtract X to prevent overflow.
                displayRect.Width = int.MaxValue - displayRect.X;
            }

            for (int i = 0; i < container.Children.Count;)
            {
                Size rowSize = Size.Empty;

                Rectangle measureBounds = new Rectangle(displayRect.X, displayRect.Y, displayRect.Width, displayRect.Height - layoutSize.Height);
                rowSize = MeasureRow(containerProxy, elementProxy, i, measureBounds, out int breakIndex);

                // if we are not wrapping contents, then the breakIndex (as set in MeasureRow)
                // should be equal to the count of child items in the container.
                Debug.Assert(wrapContents == true || breakIndex == container.Children.Count,
                             "We should not be trying to break the row if we are not wrapping contents.");

                if (!measureOnly)
                {
                    Rectangle rowBounds = new Rectangle(displayRect.X,
                                                        layoutSize.Height + displayRect.Y,
                                                        rowSize.Width,
                                                        rowSize.Height);
                    LayoutRow(containerProxy, elementProxy, startIndex: i, endIndex: breakIndex, rowBounds: rowBounds);
                }

                layoutSize.Width   = Math.Max(layoutSize.Width, rowSize.Width);
                layoutSize.Height += rowSize.Height;
                i = breakIndex;
            }

            // Verify that our alignment is correct
            if (container.Children.Count != 0 && !measureOnly)
            {
                Debug_VerifyAlignment(container, flowDirection);
            }

            return(LayoutUtils.FlipSizeIf(flowDirection == FlowDirection.TopDown || GetFlowDirection(container) == FlowDirection.BottomUp, layoutSize));
        }
Exemplo n.º 4
0
            public ProxyContainerContext()
            {
                this.launcher = Substitute.For <IContainerHostLauncher>();
                this.launcher.When(x => x.Start(null, null));

                this.logEmitter = Substitute.For <ILogEmitter>();

                this.tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
                Directory.CreateDirectory(this.tempDirectory);

                this.proxy = new ContainerProxy(launcher);
            }
Exemplo n.º 5
0
        /// <summary>
        /// In ocerra, we expose two connection types: OData - for all query business and OpenAPI for all CRUD operations.
        /// In this demo I want to show how to use both connections.
        /// Ocerra client was generated from OcerraNSwag file using NSwagStudio https://github.com/RicoSuter/NSwag/wiki/NSwagStudio
        /// OpenAPI metadata can be found here: https://app.ocerra.com/swagger/
        /// The OcerraOData was generated from https://app.ocerra.com/odata using Visual Studio 2019.
        /// Please, configure you connection details in App.Config file before trying this demo.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            var httpClient = new HttpClient()
            {
                BaseAddress = new Uri("https://app.ocerra.com/")
            };

            var token = Settings.Default.OcerraLogin + ":" + Settings.Default.OcerraPassword;

            token = Convert.ToBase64String(Encoding.UTF8.GetBytes(token));

            httpClient.DefaultRequestHeaders.Authorization =
                new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", token);


            var client = new OcerraClient(httpClient);

            var taxAccounts = Task.Run(async() => await client.ApiTaxAccountGetAsync(0, 5)).GetAwaiter().GetResult();

            foreach (var taxAccount in taxAccounts)
            {
                Console.WriteLine($"Tax Account Name: {taxAccount.Name}");
            }

            var container = new ContainerProxy(new Uri("https://app.ocerra.com/odata"));

            container.Configurations.RequestPipeline.OnMessageCreating = (a) =>
            {
                var request = new HttpWebRequestMessage(a);

                //Setting the values in the Authorization header
                request.SetHeader("Authorization", "Basic " + token);

                return(request);
            };

            var taxRates = container.TaxRateProxy.Take(10).ToList();

            foreach (var taxRate in taxRates)
            {
                Console.WriteLine($"Tax Rates: {taxRate.CodeProxy}");
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
 private Size xLayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds, out int breakIndex, bool measureOnly)
 {
     Point location = rowBounds.Location;
     Size empty = Size.Empty;
     int num = 0;
     breakIndex = startIndex;
     bool wrapContents = GetWrapContents(containerProxy.Container);
     bool flag2 = false;
     ArrangedElementCollection children = containerProxy.Container.Children;
     int num2 = startIndex;
     while (num2 < endIndex)
     {
         elementProxy.Element = children[num2];
         if (elementProxy.ParticipatesInLayout)
         {
             Size preferredSize;
             if (elementProxy.AutoSize)
             {
                 Size b = new Size(0x7fffffff, rowBounds.Height - elementProxy.Margin.Size.Height);
                 if (num2 == startIndex)
                 {
                     b.Width = (rowBounds.Width - empty.Width) - elementProxy.Margin.Size.Width;
                 }
                 b = LayoutUtils.UnionSizes(new Size(1, 1), b);
                 preferredSize = elementProxy.GetPreferredSize(b);
             }
             else
             {
                 preferredSize = elementProxy.SpecifiedSize;
                 if (elementProxy.Stretches)
                 {
                     preferredSize.Height = 0;
                 }
                 if (preferredSize.Height < elementProxy.MinimumSize.Height)
                 {
                     preferredSize.Height = elementProxy.MinimumSize.Height;
                 }
             }
             Size size4 = preferredSize + elementProxy.Margin.Size;
             if (!measureOnly)
             {
                 Rectangle rect = new Rectangle(location, new Size(size4.Width, rowBounds.Height));
                 rect = LayoutUtils.DeflateRect(rect, elementProxy.Margin);
                 AnchorStyles anchorStyles = elementProxy.AnchorStyles;
                 containerProxy.Bounds = LayoutUtils.AlignAndStretch(preferredSize, rect, anchorStyles);
             }
             location.X += size4.Width;
             if ((num > 0) && (location.X > rowBounds.Right))
             {
                 return empty;
             }
             empty.Width = location.X - rowBounds.X;
             empty.Height = Math.Max(empty.Height, size4.Height);
             if (wrapContents)
             {
                 if (flag2)
                 {
                     return empty;
                 }
                 if (((num2 + 1) < endIndex) && CommonProperties.GetFlowBreak(elementProxy.Element))
                 {
                     if (num == 0)
                     {
                         flag2 = true;
                     }
                     else
                     {
                         breakIndex++;
                         return empty;
                     }
                 }
             }
             num++;
         }
         num2++;
         breakIndex++;
     }
     return empty;
 }
Exemplo n.º 7
0
        private void LayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds)
        {
            int num;

            this.xLayoutRow(containerProxy, elementProxy, startIndex, endIndex, rowBounds, out num, false);
        }
Exemplo n.º 8
0
 private Size MeasureRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, Rectangle displayRectangle, out int breakIndex)
 {
     return(this.xLayoutRow(containerProxy, elementProxy, startIndex, containerProxy.Container.Children.Count, displayRectangle, out breakIndex, true));
 }
 private Size MeasureRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, Rectangle displayRectangle, out int breakIndex)
 {
     return this.xLayoutRow(containerProxy, elementProxy, startIndex, containerProxy.Container.Children.Count, displayRectangle, out breakIndex, true);
 }
Exemplo n.º 10
0
        private Size xLayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds, out int breakIndex, bool measureOnly)
        {
            Point location = rowBounds.Location;
            Size  empty    = Size.Empty;
            int   num      = 0;

            breakIndex = startIndex;
            bool wrapContents = GetWrapContents(containerProxy.Container);
            bool flag2        = false;
            ArrangedElementCollection children = containerProxy.Container.Children;
            int num2 = startIndex;

            while (num2 < endIndex)
            {
                elementProxy.Element = children[num2];
                if (elementProxy.ParticipatesInLayout)
                {
                    Size preferredSize;
                    if (elementProxy.AutoSize)
                    {
                        Size b = new Size(0x7fffffff, rowBounds.Height - elementProxy.Margin.Size.Height);
                        if (num2 == startIndex)
                        {
                            b.Width = (rowBounds.Width - empty.Width) - elementProxy.Margin.Size.Width;
                        }
                        b             = LayoutUtils.UnionSizes(new Size(1, 1), b);
                        preferredSize = elementProxy.GetPreferredSize(b);
                    }
                    else
                    {
                        preferredSize = elementProxy.SpecifiedSize;
                        if (elementProxy.Stretches)
                        {
                            preferredSize.Height = 0;
                        }
                        if (preferredSize.Height < elementProxy.MinimumSize.Height)
                        {
                            preferredSize.Height = elementProxy.MinimumSize.Height;
                        }
                    }
                    Size size4 = preferredSize + elementProxy.Margin.Size;
                    if (!measureOnly)
                    {
                        Rectangle rect = new Rectangle(location, new Size(size4.Width, rowBounds.Height));
                        rect = LayoutUtils.DeflateRect(rect, elementProxy.Margin);
                        AnchorStyles anchorStyles = elementProxy.AnchorStyles;
                        containerProxy.Bounds = LayoutUtils.AlignAndStretch(preferredSize, rect, anchorStyles);
                    }
                    location.X += size4.Width;
                    if ((num > 0) && (location.X > rowBounds.Right))
                    {
                        return(empty);
                    }
                    empty.Width  = location.X - rowBounds.X;
                    empty.Height = Math.Max(empty.Height, size4.Height);
                    if (wrapContents)
                    {
                        if (flag2)
                        {
                            return(empty);
                        }
                        if (((num2 + 1) < endIndex) && CommonProperties.GetFlowBreak(elementProxy.Element))
                        {
                            if (num == 0)
                            {
                                flag2 = true;
                            }
                            else
                            {
                                breakIndex++;
                                return(empty);
                            }
                        }
                    }
                    num++;
                }
                num2++;
                breakIndex++;
            }
            return(empty);
        }
Exemplo n.º 11
0
 // Just forwards to xLayoutRow.  breakIndex is the index of the first control not to fit in the displayRectangle.  The
 // returned Size is the size required to layout the controls from startIndex up to but not including breakIndex.  See
 // the ElementProxy class for an explaination of the elementProxy parameter.
 private Size MeasureRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, Rectangle displayRectangle, out int breakIndex)
 {
     return(xLayoutRow(containerProxy, elementProxy, startIndex, /* endIndex = */ containerProxy.Container.Children.Count, displayRectangle, out breakIndex, /* measureOnly = */ true));
 }
Exemplo n.º 12
0
        // LayoutRow and MeasureRow both forward to this method.  The measureOnly flag determines which behavior we get.
        private Size xLayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds, out int breakIndex, bool measureOnly)
        {
            Debug.Assert(startIndex < endIndex, "Loop should be in forward Z-order.");
            Point location     = rowBounds.Location;
            Size  rowSize      = Size.Empty;
            int   laidOutItems = 0;

            breakIndex = startIndex;

            bool wrapContents    = GetWrapContents(containerProxy.Container);
            bool breakOnNextItem = false;


            ArrangedElementCollection collection = containerProxy.Container.Children;

            for (int i = startIndex; i < endIndex; i++, breakIndex++)
            {
                elementProxy.Element = collection[i];

                if (!elementProxy.ParticipatesInLayout)
                {
                    continue;
                }

                // Figure out how much space this element is going to need (requiredSize)
                //
                Size prefSize;
                if (elementProxy.AutoSize)
                {
                    Size elementConstraints = new Size(Int32.MaxValue, rowBounds.Height - elementProxy.Margin.Size.Height);
                    if (i == startIndex)
                    {
                        // If the element is the first in the row, attempt to pack it to the row width.  (If its not 1st, it will wrap
                        // to the first on the next row if its too long and then be packed if needed by the next call to xLayoutRow).
                        elementConstraints.Width = rowBounds.Width - rowSize.Width - elementProxy.Margin.Size.Width;
                    }

                    // Make sure that subtracting the margins does not cause width/height to be <= 0, or we will
                    // size as if we had infinite space when in fact we are trying to be as small as possible.
                    elementConstraints = LayoutUtils.UnionSizes(new Size(1, 1), elementConstraints);
                    prefSize           = elementProxy.GetPreferredSize(elementConstraints);
                }
                else
                {
                    // If autosizing is turned off, we just use the element's current size as its preferred size.
                    prefSize = elementProxy.SpecifiedSize;

                    // except if it is stretching - then ignore the affect of the height dimension.
                    if (elementProxy.Stretches)
                    {
                        prefSize.Height = 0;
                    }

                    // Enforce MinimumSize
                    if (prefSize.Height < elementProxy.MinimumSize.Height)
                    {
                        prefSize.Height = elementProxy.MinimumSize.Height;
                    }
                }
                Size requiredSize = prefSize + elementProxy.Margin.Size;

                // Position the element (if applicable).
                //
                if (!measureOnly)
                {
                    // If measureOnly = false, rowBounds.Height = measured row hieght
                    // (otherwise its the remaining displayRect of the container)

                    Rectangle cellBounds = new Rectangle(location, new Size(requiredSize.Width, rowBounds.Height));

                    // We laid out the rows with the elementProxy's margins included.
                    // We now deflate the rect to get the actual elementProxy bounds.
                    cellBounds = LayoutUtils.DeflateRect(cellBounds, elementProxy.Margin);

                    AnchorStyles anchorStyles = elementProxy.AnchorStyles;
                    containerProxy.Bounds = LayoutUtils.AlignAndStretch(prefSize, cellBounds, anchorStyles);
                }

                // Keep track of how much space is being used in this row
                //

                location.X += requiredSize.Width;



                if (laidOutItems > 0)
                {
                    // If control does not fit on this row, exclude it from row and stop now.
                    //   Exception: If row is empty, allow this control to fit on it. So controls
                    //   that exceed the maximum row width will end up occupying their own rows.
                    if (location.X > rowBounds.Right)
                    {
                        break;
                    }
                }
                // Control fits on this row, so update the row size.
                //   rowSize.Width != location.X because with a scrollable control
                //   we could have started with a location like -100.

                rowSize.Width = location.X - rowBounds.X;

                rowSize.Height = Math.Max(rowSize.Height, requiredSize.Height);

                // check for line breaks.
                if (wrapContents)
                {
                    if (breakOnNextItem)
                    {
                        break;
                    }
                    else if (i + 1 < endIndex && CommonProperties.GetFlowBreak(elementProxy.Element))
                    {
                        if (laidOutItems == 0)
                        {
                            breakOnNextItem = true;
                        }
                        else
                        {
                            breakIndex++;
                            break;
                        }
                    }
                }
                ++laidOutItems;
            }

            return(rowSize);
        }
Exemplo n.º 13
0
 // Just forwards to xLayoutRow.  This will layout elements from the start index to the end index.  RowBounds
 // was computed by a call to measure row and is used for alignment/boxstretch.  See the ElementProxy class
 // for an explaination of the elementProxy parameter.
 private void LayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds) {
     int dummy;
     Size outSize = xLayoutRow(containerProxy, elementProxy, startIndex, endIndex, rowBounds, /* breakIndex = */ out dummy, /* measureOnly = */ false);
     Debug.Assert(dummy == endIndex, "EndIndex / BreakIndex mismatch.");
 }
 private void LayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds)
 {
     int num;
     this.xLayoutRow(containerProxy, elementProxy, startIndex, endIndex, rowBounds, out num, false);
 }
Exemplo n.º 15
0
 /// <summary>
 ///  Just forwards to TryCalculatePreferredSizeRow. breakIndex is the index of the first control not to
 ///  fit in the displayRectangle. The returned Size is the size required to layout the
 ///  controls from startIndex up to but not including breakIndex. See the ElementProxy
 ///  class for an explaination of the elementProxy parameter.
 /// </summary>
 private Size MeasureRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, Rectangle displayRectangle, out int breakIndex)
 {
     return(TryCalculatePreferredSizeRow(containerProxy, elementProxy, startIndex, endIndex: containerProxy.Container.Children.Count, rowBounds: displayRectangle, breakIndex: out breakIndex, measureOnly: true));
 }
Exemplo n.º 16
0
 // Just forwards to xLayoutRow.  breakIndex is the index of the first control not to fit in the displayRectangle.  The
 // returned Size is the size required to layout the controls from startIndex up to but not including breakIndex.  See
 // the ElementProxy class for an explaination of the elementProxy parameter.
 private Size MeasureRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, Rectangle displayRectangle, out int breakIndex) {
     return xLayoutRow(containerProxy, elementProxy, startIndex, /* endIndex = */ containerProxy.Container.Children.Count, displayRectangle, out breakIndex, /* measureOnly = */ true);
 }
Exemplo n.º 17
0
        // LayoutRow and MeasureRow both forward to this method.  The measureOnly flag determines which behavior we get.
        private Size xLayoutRow(ContainerProxy containerProxy, ElementProxy elementProxy, int startIndex, int endIndex, Rectangle rowBounds, out int breakIndex, bool measureOnly) {
            Debug.Assert(startIndex < endIndex, "Loop should be in forward Z-order.");
            Point location = rowBounds.Location;
            Size rowSize = Size.Empty;
            int laidOutItems = 0;
            breakIndex = startIndex;

            bool wrapContents = GetWrapContents(containerProxy.Container);
            bool breakOnNextItem = false;

            
            ArrangedElementCollection collection = containerProxy.Container.Children;
            for(int i = startIndex; i < endIndex; i++, breakIndex++) {
                elementProxy.Element = collection[i];

                if(!elementProxy.ParticipatesInLayout) {
                    continue;
                }

                // Figure out how much space this element is going to need (requiredSize)
                //
                Size prefSize;
                if(elementProxy.AutoSize) {
                    Size elementConstraints = new Size(Int32.MaxValue, rowBounds.Height - elementProxy.Margin.Size.Height);
                    if(i == startIndex) {
                        // If the element is the first in the row, attempt to pack it to the row width.  (If its not 1st, it will wrap
                        // to the first on the next row if its too long and then be packed if needed by the next call to xLayoutRow).
                        elementConstraints.Width = rowBounds.Width - rowSize.Width - elementProxy.Margin.Size.Width;
                    }

                    // Make sure that subtracting the margins does not cause width/height to be <= 0, or we will
                    // size as if we had infinite space when in fact we are trying to be as small as possible.
                    elementConstraints = LayoutUtils.UnionSizes(new Size(1, 1), elementConstraints);                    
                    prefSize = elementProxy.GetPreferredSize(elementConstraints);
                } else {
                    // If autosizing is turned off, we just use the element's current size as its preferred size.
                    prefSize = elementProxy.SpecifiedSize;

                    // VSWhidbey 406227
                    // except if it is stretching - then ignore the affect of the height dimension.
                    if (elementProxy.Stretches) {
                        prefSize.Height = 0;
                    } 

                    // Enforce MinimumSize
                    if (prefSize.Height < elementProxy.MinimumSize.Height) {
                        prefSize.Height = elementProxy.MinimumSize.Height;
                    }
                }
                Size requiredSize = prefSize + elementProxy.Margin.Size;

                // Position the element (if applicable).
                //
                if(!measureOnly) {
                    // If measureOnly = false, rowBounds.Height = measured row hieght
                    // (otherwise its the remaining displayRect of the container)
                    
                    Rectangle cellBounds = new Rectangle(location, new Size(requiredSize.Width, rowBounds.Height));

                    // We laid out the rows with the elementProxy's margins included.
                    // We now deflate the rect to get the actual elementProxy bounds.
                    cellBounds = LayoutUtils.DeflateRect(cellBounds, elementProxy.Margin);
                    
                    AnchorStyles anchorStyles = elementProxy.AnchorStyles;
                    containerProxy.Bounds = LayoutUtils.AlignAndStretch(prefSize, cellBounds, anchorStyles);
                }
        
                // Keep track of how much space is being used in this row
                //
              
                location.X += requiredSize.Width;
                

               
                if (laidOutItems > 0) {
                    // If control does not fit on this row, exclude it from row and stop now.
                    //   Exception: If row is empty, allow this control to fit on it. So controls
                    //   that exceed the maximum row width will end up occupying their own rows.
                    if(location.X > rowBounds.Right) {
                        break;
                    }

                }
                // Control fits on this row, so update the row size.
                //   rowSize.Width != location.X because with a scrollable control
                //   we could have started with a location like -100.
                
                rowSize.Width = location.X - rowBounds.X;
                
                rowSize.Height = Math.Max(rowSize.Height, requiredSize.Height);

                // check for line breaks.
                if (wrapContents) {
                    if (breakOnNextItem) {
                        break;
                    }
                    else if (i+1 < endIndex && CommonProperties.GetFlowBreak(elementProxy.Element)) {
                        if (laidOutItems == 0) {
                            breakOnNextItem = true;
                        }
                        else {
                            breakIndex++;
                            break;
                        }
                   }
                }
                ++laidOutItems;
            }

            return rowSize;
        }