예제 #1
0
        public virtual void LocateColumn(IEnumerable <TItem> col, Rectangle colBounds, Rectangle bounds, AlignerOptions options)
        {
            var colPos = bounds.Location;
            var locate = new LocateVisitBuilder <TItem> (this.Locator);

            LocateColumn(col, colBounds, bounds, ref colPos, locate, options);
        }
예제 #2
0
        public virtual void LocateColumns(Queue <Tuple <IEnumerable <TItem>, Rectangle> > cols, Rectangle bounds, AlignerOptions options)
        {
            var colPos = bounds.Location;
            var locate = new LocateVisitBuilder <TItem>(this.Locator);

            while (cols.Count > 0)
            {
                var col = cols.Dequeue();
                LocateColumn(col.Item1, col.Item2, bounds, ref colPos, locate, options);
            }
        }
예제 #3
0
        public virtual void OneColumn(IEnumerable <TItem> items, Point at, AlignerOptions options)
        {
            var bounds = new Rectangle(int.MaxValue, int.MaxValue, 0, 0);

            MeasureColumn(items, options, ref bounds);
            if (bounds.Location == new Point(int.MaxValue, int.MaxValue))  // this happens if items have no shape
            {
                bounds.Location = at;
            }
            var locator = new LocateVisitBuilder <TItem>(this.Locator);

            LocateColumn(items, bounds, bounds, ref at, locator, options);
        }
예제 #4
0
        public virtual void OneColumn(IEnumerable <TItem> items, AlignerOptions options)
        {
            var comparer = new PointComparer {
                Order = options.PointOrder, Delta = options.PointOrderDelta
            };
            var colItems = items.OrderBy(item => Locator.GetLocation(item), comparer);
            var bounds   = new Rectangle(int.MaxValue, int.MaxValue, 0, 0);

            MeasureColumn(colItems, options, ref bounds);
            var colPos  = bounds.Location;
            var locator = new LocateVisitBuilder <TItem>(this.Locator);

            LocateColumn(colItems, bounds, bounds, ref colPos, locator, options);
        }
예제 #5
0
        public virtual void LocateColumn(IEnumerable <TItem> col, Rectangle colBounds, ref Point colPos, AlignerOptions options)
        {
            var locate = new LocateVisitBuilder <TItem> (this.Locator);

            LocateColumn(col, colBounds, new Rectangle(colPos, new Size()), ref colPos, locate, options);
        }