Ejemplo n.º 1
0
        public static TimedComponent Create(FbEventArgs i_Args, FacebookAppEngine i_Engine, eTasksType i_ChosenTask)
        {
            TimedComponent timedComponent = new TimedComponent {
                FbEventArgs = i_Args, ActionObject = FbActionFactory.Create(i_Engine, i_ChosenTask), Timer = new System.Timers.Timer(), Invoked = false
            };

            timedComponent.ActionObject.LoadAction();
            timedComponent.Timer.Enabled  = false;
            timedComponent.Timer.Elapsed += new System.Timers.ElapsedEventHandler(timedComponent.OnElapsed);

            if ((timedComponent.FbEventArgs.Time - DateTime.Now).TotalMilliseconds > 0)
            {
                timedComponent.Timer.Interval = (timedComponent.FbEventArgs.Time - DateTime.Now).TotalMilliseconds;
            }
            else
            {
                // if the time already passed, we commit the action immediately
                timedComponent.Timer.Interval = 0.1;
            }

            return(timedComponent);
        }
 public void RaiseEvent(FbEventArgs e)
 {
     DoWhenFinished?.Invoke(this, e);
 }
Ejemplo n.º 3
0
 private void postLinkAction(object sender, FbEventArgs e)
 {
     m_Engine.PostChosenLink(e.Link, e.StatusBody);
 }
 public TimedComponent CreateTimedComponent(FbEventArgs args, eTasksType taskType)
 {
     return(TimedComponent.Create(args, this, taskType));
 }
Ejemplo n.º 5
0
 private void postStatusAction(object sender, FbEventArgs e)
 {
     m_Engine.PostStatus(e.StatusBody);
 }
 private void postPhotoAction(object sender, FbEventArgs e)
 {
     m_Engine.PostChosenPhoto(e.PathToImage, e.StatusBody);
 }