public void Apply(AlignUnitsCollection units) { Padding padding = new Padding(0); for (int i = 0; i < units.RowCount; i++) { AlignUnit maxUnitInRow = units.GetMaxUnitInRow(i); if (maxUnitInRow == null) { padding = new Padding(0); } else { AlignUnit minUnitInRow = units.GetMinUnitInRow(i); Padding padding2 = maxUnitInRow.CompareMargin - minUnitInRow.CompareMargin; padding2 = ((padding2.Vertical > maxUnitInRow.InlinedMargin.Vertical) ? padding2 : maxUnitInRow.InlinedMargin); foreach (AlignUnit alignUnit in units.GetAlignUnitsInRow(i)) { alignUnit.ResultMargin = maxUnitInRow.CompareMargin - alignUnit.CompareMargin; } units.RowDeltaValue[i] = units.RowDeltaValue[i] - padding.Bottom - padding2.Top; if (units.RowDeltaValue[i] < DefaultAlignRule.MinimalVertical) { units.RowDeltaValue[i] = DefaultAlignRule.MinimalVertical; } padding = padding2; } } if (units.RowCount > 0) { units.RowDeltaValue[0] = 0; } }
public void Apply(AlignUnitsCollection collection) { int num = collection.ColumnCount; for (int i = 0; i < collection.RowCount; i++) { IList <AlignUnit> alignUnitsInRow = collection.GetAlignUnitsInRow(i); if (alignUnitsInRow.Count > 0) { AlignUnit alignUnit = alignUnitsInRow[0]; if (alignUnit.Column < num && this.IsTypeMatch(alignUnit)) { num = alignUnit.Column; } if (alignUnit.Column > num && collection.RowDeltaValue[i] > 8) { collection.RowDeltaValue[i] = 8; } } } }