public LongActionForm(ILongAction action) { InitializeComponent(); Text = action.Caption; var interfaceContainer = new InterfaceContainer(action, labelText, labelProgress, progressBarProgress); this.action = action; action.InterfaceContainer = interfaceContainer; }
public InterfaceContainer(ILongAction action, Label textLabel, Label progressLabel, ProgressBar progressBar) { this.textLabel = textLabel; this.progressLabel = progressLabel; this.progressBar = progressBar; this.action = action; progressBar.Maximum = action.Max; UpdateProgress(0); textLabel.Text = action.Text; }