Esempio n. 1
0
 private void DataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         {
             GreigeRoll roll = this.sewinQueue.Rolls[e.RowIndex];
             if (e.ColumnIndex == this.colMeasuredLength.Index)
             {
                 if (e.RowIndex < this.logic.CurrentRollIndex)
                 {
                     (e.CellStyle.ForeColor, e.CellStyle.BackColor) =
                         roll.RollLength == 0 ?
                         new CellColor {
                         ForeColor = this.dataGridView1.DefaultCellStyle.ForeColor, BackColor = this.dataGridView1.DefaultCellStyle.BackColor
                     } :
                     CellColor.GetFeetColor(roll.RollLength, (long)e.Value, this.serviceSettings);
                 }
             }
             else if (roll.IsComplete)
             {
                 (e.CellStyle.ForeColor, e.CellStyle.BackColor) = CellColor.IsCompletedColor;
             }
         }
     }
 }
Esempio n. 2
0
        public void SetFeetColor(DataGridViewCellFormattingEventArgs args, IServiceSettings settings)
        {
            GreigeRoll roll           = (GreigeRoll)this.grdGreigeRoll.Rows[args.RowIndex].DataBoundItem;
            long       measuredLength = (long)args.Value;

            (args.CellStyle.ForeColor, args.CellStyle.BackColor) =
                roll.RollLength == 0 ? this.defaultCellColor :
                CellColor.GetFeetColor(roll.RollLength, (long)args.Value, this.serviceSettings);
        }