private void addATimedCommandToCommit() { if (listBoxActions.SelectedItem != null) { IProxyForm CommandForm = listBoxActions.SelectedItem as IProxyForm; DialogResult dialogResult = CommandForm.ShowDialog(); if (dialogResult == DialogResult.OK) { IfbAutomatable fbTaskToAutomate = CommandForm as IfbAutomatable; FbEventArgs args = fbTaskToAutomate?.CollectData(); eTasksType taskType = (eTasksType)fbTaskToAutomate?.GetTaskType(); TimedComponent timedComponent = m_FacebookApp.CreateTimedComponent(args, taskType); timedComponent.ActionObject.DoWhenFinishedError += (i_object, i_e) => MessageBox.Show(string.Format("there was a probloem during invoking the {0} action", timedComponent.ActionObject.GetName())); IControl s = new CheckBoxedTimedComponentUIControl(new TimedComponentUIControl(timedComponent)); m_TimedComponentsNotYetInvoked.Add(s); flowLayoutPanel1.Controls.Add(s.CreateUIControl()); timedComponent.Timer.Elapsed += (i_object, i_e) => s.Update(); timedComponent.Timer.Start(); } } }
public TimedComponentUIControl(TimedComponent i_Component) { m_TimedComponent = i_Component; }