Exemplo n.º 1
0
        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 FbEventArgs CollectData()
        {
            FbEventArgs result = new FbEventArgs {
                StatusBody = StatusBody, Time = TimeToExecute, Link = LinkUrl
            };

            return(result);
        }
        public FbEventArgs CollectData()
        {
            FbEventArgs result = new FbEventArgs {
                StatusBody = StatusBody, Time = TimeToExecute, PathToImage = PathToImage
            };

            return(result);
        }