Exemplo n.º 1
0
 public void Apply(AlignUnitsCollection collection)
 {
     foreach (AlignUnit controlStyle in collection.Units)
     {
         this.SetControlStyle(controlStyle);
     }
 }
Exemplo n.º 2
0
        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 units)
 {
     foreach (AlignUnit alignUnit in units.Units)
     {
         if (units.RowDeltaValue[alignUnit.Row] > this.deltaValue && this.Match(alignUnit, units))
         {
             units.RowDeltaValue[alignUnit.Row] = this.deltaValue;
         }
     }
 }
Exemplo n.º 4
0
 public void Apply(AlignUnitsCollection collection)
 {
     foreach (AlignUnit alignUnit in collection.Units)
     {
         if (this.Match(alignUnit, collection) && alignUnit.ResultMargin.Left + alignUnit.Control.Padding.Left < this.leftPadding.Left)
         {
             alignUnit.ResultMargin += this.leftPadding;
         }
     }
 }
Exemplo n.º 5
0
 private bool Match(AlignUnit unit, AlignUnitsCollection collection)
 {
     foreach (Type type in this.excludedTypes)
     {
         if (type.IsAssignableFrom(unit.Control.GetType()))
         {
             return(false);
         }
     }
     return(true);
 }
 private bool Match(AlignUnit unit, AlignUnitsCollection collection)
 {
     foreach (RelativeControlAlignRule.Condition condition in this.conditionsList)
     {
         AlignUnit offsetUnit = collection.GetOffsetUnit(unit, condition.OffsetRow, condition.OffSetColumn);
         if (!this.IsConditionMatch(condition, offsetUnit))
         {
             return(false);
         }
     }
     return(true);
 }
        private void AdjustLayout(LayoutEventArgs e)
        {
            AlignUnitsCollection alignUnitsCollectionFromTLP = AlignUnitsCollection.GetAlignUnitsCollectionFromTLP(this);

            foreach (IAlignRule alignRule in AlignSettings.RulesList)
            {
                alignRule.Apply(alignUnitsCollectionFromTLP);
            }
            foreach (AlignUnit alignUnit in alignUnitsCollectionFromTLP.Units)
            {
                alignUnit.Control.Margin = LayoutHelper.Scale(alignUnit.ResultMargin + new Padding(0, alignUnitsCollectionFromTLP.RowDeltaValue[alignUnit.Row], 0, 0), this.scaleFactor);
            }
        }
Exemplo n.º 8
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;
                    }
                }
            }
        }