Example #1
0
 public int GetEnumerator()
 {
     if (this.Rows.Count > 0)
     {
         if (this.currentRow == null)
         {
             this.currentRow = this.Rows[0];
         }
         else
         {
             int index = this.Rows.FindIndex(e => e == this.currentRow);
             if ((this.Rows.Count - 1) > index)
             {
                 this.currentRow = this.Rows[index + 1];
                 return(index + 1);
             }
             else
             {
                 this.currentRow = this.Rows[0];
             }
         }
     }
     else
     {
         this.currentRow = null;
         return(-1);
     }
     return(0);
 }
Example #2
0
 public void setCurRow(int index)
 {
     if (this.Rows.Count > index && index >= 0)
     {
         this.currentRow = this.Rows[index];
     }
     throw new IndexOutOfRangeException($"{this.Name} (DataGrid) has only {this.Rows.Count} rows. Requested index: {index}");
 }
Example #3
0
        public void UpdateCurrentRowOfDG(string DgName)
        {
            FG_DataGrid DG = DataGrids.Find(e => e.Name == DgName);

            if (DG == null)
            {
                throw new Exception("Exception in UpdateCurrentRowOfDG- DG not found in: " + DgName);
            }

            FG_Row row = new FG_Row();

            foreach (FG_Control fgCtrl in DG.RowModel.Controls)
            {
                row.Controls.Add(new FG_Control(fgCtrl.Name, fgCtrl.Value));
            }
            DG.Rows.Add(row);
            DG.currentRow = row;
        }
Example #4
0
 public FG_DataGrid(string name, List <FG_Row> rows, FG_Row rowModel)
 {
     this.Name     = name;
     this.Rows     = rows;
     this.RowModel = rowModel;
 }