public async void ObjectStorageFileList() { nlog.Warn("ObjectStorageFileList Started"); workObjectStorage = true; StatusUpdate(Status.Working); try { ConfigSaveAllItem(); Task <List <ObjectStorageFile> > result = objectStorage.list(config.GetEnumValue(Category.Config, Key.ObjectBucket)); dgvObjectStorage.InvokeIfRequired(s => { s.Rows.Clear(); s.RowHeadersVisible = false; s.BackgroundColor = Color.White; }); List <ObjectStorageFile> files = await result; long uiRefresh = 0; foreach (var file in files) { if ((System.Text.RegularExpressions.Regex.IsMatch(file.Name , textFilterString.Text , System.Text.RegularExpressions.RegexOptions.IgnoreCase)) || textFilterString.Text.Length == 0 ) { dgvObjectStorage.InvokeIfRequired(s => { int n = s.Rows.Add(); s.Rows[n].Cells[0].Value = "false"; s.Rows[n].Cells[1].Value = file.Name; s.Rows[n].Cells[2].Value = file.Length; s.Rows[n].Cells[3].Value = String.Format("{0:yyyy-MM-dd HH:mm:ss}", System.DateTime.Parse(file.LastWriteTime)); }); } if (uiRefresh % 100 == 0) { StatusUpdate(Status.Working); } uiRefresh++; } } catch (Exception ex) { nlog.Error(string.Format("{0},{1}", ex.Message, ex.StackTrace)); workObjectStorage = false; } StatusUpdate(Status.Completed); workObjectStorage = false; nlog.Warn("ObjectStorageFileList Completed"); }