Beispiel #1
0
    void FillList()
    {
        var index = 0;

        DataManager.companiesList.ForEach(x => {
            companyCell.Add(CompanyCell.Instantiate(cellPrefab, x, index, delegate(CompanyModel company, int mindex) {
                OnCompanySelected(company, mindex);
            }));
            index++;
        });
        StartCoroutine(OnFillList());
    }
 private void ConvertCellsToSpecificCellType(string cellType)
 {
     if (dgv.Columns.Contains(cellType))
     {
         foreach (var row in dgv.Rows)
         {
             DataGridViewRow dgvRow = row as DataGridViewRow;
             if (dgvRow != null)
             {
                 DataGridViewCell newSpecificCell = null;
                 if (cellType.Equals("Candidate"))
                 {
                     newSpecificCell = new CandidateCell(dgvRow.Cells[cellType].Value as ICandidate);
                 }
                 else if (cellType.Equals("Company"))
                 {
                     newSpecificCell = new CompanyCell(dgvRow.Cells[cellType].Value as ICompany);
                 }
                 else
                 {
                     break;
                 }
                 dgvRow.Cells[cellType] = newSpecificCell;
             }
         }
     }
 }