public void UpdateGridRowView(int rowIndex, ActionBase actionObject) { UpdateCellIcon(rowIndex, actionObject); //类型 string actionType = actionObject.ActionDisplayName; this[rowIndex, 1] = new SourceGrid.Cells.Cell(actionType); AutoWidthColumn(actionType, rowIndex, 1); UpdateRow(rowIndex, actionObject); //说明 string desc = actionObject.Title; if (string.IsNullOrEmpty(desc)) { desc = actionObject.GetDescription(); } this[rowIndex, 4] = new SourceGrid.Cells.Cell(desc); AutoWidthColumn(desc, rowIndex, 4); Rows.SetHeight(rowIndex, 30); InvalidateRange(Rows[rowIndex].Range); }
private void setupRowDetails() { AppliesTo = Action.AppliesTo; Title = Action.GetTitle(); Error = (Action.Exception != null) && !(Action.Exception is CancelledException); Image = Action.GetImage(); ShowTime = Action.Finished - Action.Started >= TimeSpan.FromSeconds(1); Description = Action.GetDescription(); ShowProgress = Action.ShowProgress && !Action.IsCompleted; ShowCancel = !Action.IsCompleted; Progress = Action.PercentComplete; CancelEnabled = Action.CanCancel; if (Action.IsCompleted) { finished = Action.Finished; if (ParentPanel != null) { Program.BeginInvoke(ParentPanel, () => ParentPanel.Refresh()); } } }