Esempio n. 1
0
        private void CopyEventsSubscriptionsHandler(out List <TimeChangedDelegate> durationChangedSubscriptions,
                                                    out List <TimeChangedDelegate> currentTimeChangedSubscriptions,
                                                    out List <TimeDelegate> timeFlowStartedSubscriptions,
                                                    out List <TimeDelegate> timeFlowStoppedSubscriptions,
                                                    out List <TimeDelegate> timeFlowPausedSubscriptions)
        {
            durationChangedSubscriptions    = new List <TimeChangedDelegate>();
            currentTimeChangedSubscriptions = new List <TimeChangedDelegate>();
            timeFlowStartedSubscriptions    = new List <TimeDelegate>();
            timeFlowStoppedSubscriptions    = new List <TimeDelegate>();
            timeFlowPausedSubscriptions     = new List <TimeDelegate>();

            if (DurationChanged != null)
            {
                durationChangedSubscriptions = Array.ConvertAll(DurationChanged.GetInvocationList(), item => (TimeChangedDelegate)item).ToList();
            }
            if (CurrentTimeChanged != null)
            {
                currentTimeChangedSubscriptions = Array.ConvertAll(CurrentTimeChanged.GetInvocationList(), item => (TimeChangedDelegate)item).ToList();
            }
            if (TimeFlowStarted != null)
            {
                timeFlowStartedSubscriptions = Array.ConvertAll(TimeFlowStarted.GetInvocationList(), item => (TimeDelegate)item).ToList();
            }
            if (TimeFlowStopped != null)
            {
                timeFlowStoppedSubscriptions = Array.ConvertAll(TimeFlowStopped.GetInvocationList(), item => (TimeDelegate)item).ToList();
            }
            if (TimeFlowPaused != null)
            {
                timeFlowPausedSubscriptions = Array.ConvertAll(TimeFlowPaused.GetInvocationList(), item => (TimeDelegate)item).ToList();
            }
        }
Esempio n. 2
0
 public void ClearCallback()
 {
     if (StartDelayChanged != null)
     {
         foreach (Delegate d in StartDelayChanged.GetInvocationList())
         {
             StartDelayChanged -= (EventHandler)d;
         }
     }
     if (DurationChanged != null)
     {
         foreach (Delegate d in DurationChanged.GetInvocationList())
         {
             DurationChanged -= (EventHandler)d;
         }
     }
     if (PositionRequest != null)
     {
         foreach (Delegate d in PositionRequest.GetInvocationList())
         {
             PositionRequest -= (EventHandler)d;
         }
     }
     if (StartCallback != null)
     {
         foreach (Delegate d in StartCallback.GetInvocationList())
         {
             StartCallback -= (EventHandler)d;
         }
     }
     if (StopCallback != null)
     {
         foreach (Delegate d in StopCallback.GetInvocationList())
         {
             StopCallback -= (EventHandler)d;
         }
     }
     if (NextCallback != null)
     {
         foreach (Delegate d in NextCallback.GetInvocationList())
         {
             NextCallback -= (EventHandler)d;
         }
     }
     if (PrevCallback != null)
     {
         foreach (Delegate d in PrevCallback.GetInvocationList())
         {
             PrevCallback -= (EventHandler)d;
         }
     }
 }