private async Task DownloadDataAndAddToTable()
{
tablesForSavingData = await Serialization.DownloadTable(filePath);
if (tablesForSavingData.Count != 0)
{
int i = 1;
foreach (var table in tablesForSavingData)
{
tablesForViewData.Add(
table.ToDataGridView("table" + (i++).ToString()));
}
}
else tablesForViewData.Add(defaultTable);
Invoke(() =>
{
foreach (var table in tablesForViewData)
{
Controls.Add(table);
MakeTableActive(table);
}
});
}