public void InitializeTable(Dictionary <int, string> dirFiles) { files = new DownloadableFiles(); foreach (var file in dirFiles) { string[] values = file.Value.Split(':'); string filename = values[0]; string size = values[1]; ServerFile serverfile = new ServerFile { id = file.Key, name = filename, size = long.Parse(size) }; files.Add(serverfile); string[] row = { file.Key + "", serverfile.name, ServerFile.GetReadableSize(serverfile.size) }; filesDataGridView.Rows.Add(row); } AdjustDataGridViewHeight(); AdjustDataGridViewWidth(); }
public void Update(Map map) { FullName = map.FullName; Size = map.Size; CanDownload = map.CanDownload; AlreadyDownloaded = map.AlreadyDownloaded; DownloadableFiles.AddRange(map.DownloadableFiles); Visible = map.Visible; State = map.State; Progress = map.Progress; }