public void RefreshGrid()
        {
            PatternRows.Clear();

            for (int i = 0; i < YHeight; i++)
            {
                PatternRow row = new PatternRow(i, true);

                for (int j = 0; j < row.Leds.Length; j++)
                {
                    row.Leds[j].Type = ELedType.Disabled;
                }

                PatternRows.Add(row);
            }

            patternGridView.BeginUpdate();
            try
            {
                GridColumn col = patternGridView.Columns[0];
                col.AppearanceCell.BackColor            = Color.FromArgb(245, 245, 247);
                col.AppearanceCell.Options.UseBackColor = true;
                col.VisibleIndex = 0;

                for (int i = 0; i < XMaxLength; i++)
                {
                    col = patternGridView.Columns[i + 1];
                    col.AppearanceCell.BackColor            = Color.White;
                    col.AppearanceCell.Options.UseBackColor = true;
                    col.Visible = false;
                }

                for (int i = 0; i < XLength; i++)
                {
                    col = patternGridView.Columns[i + 1];
                    col.VisibleIndex = i + 1;
                }
            }
            finally
            {
                patternGridView.EndUpdate();
            }
        }
Beispiel #2
0
        private void RefreshPatternGrid(int length, int height)
        {
            patternRows.Clear();

            for (int i = 0; i < height; i++)
            {
                PatternRow row = new PatternRow(i);

                for (int j = 0; j < length; j++)
                {
                    row.Leds[j].Enabled = true;
                }

                patternRows.Add(row);
            }

            patternGridView.BeginUpdate();

            try
            {
                patternGridView.Columns[0].AppearanceCell.BackColor            = Color.FromArgb(245, 245, 247);
                patternGridView.Columns[0].AppearanceCell.Options.UseBackColor = true;
                patternGridView.Columns[0].Visible = true;

                for (int i = 0; i < length; i++)
                {
                    patternGridView.Columns[i + 1].AppearanceCell.BackColor            = Color.White;
                    patternGridView.Columns[i + 1].AppearanceCell.Options.UseBackColor = true;
                    patternGridView.Columns[i + 1].Visible = true;
                }
            }
            finally
            {
                patternGridView.EndUpdate();
            }
        }