Exemplo n.º 1
0
 /// <summary>
 /// Process User Events
 /// </summary>
 /// <param name="args">Event args</param>
 public virtual void Update(UserEventArgs args)
 {
 }
Exemplo n.º 2
0
 static void OnUserEvent(UserEventArgs e)
 {
     if (UserEvent != null || ChannelFinished != null || MusicFinished != null)
     {
         object ret;
         lock (instance)
         {
             ret = (UserEventArgs)userEvents[e.UserCode];
         }
         if (ret != null)
         {
             if (ret.GetType().Name == "ChannelFinishedEventArgs")
             {
                 if (ChannelFinished != null)
                 {
                     ChannelFinished(instance, (ChannelFinishedEventArgs)ret);
                 }
             }
             else if (ret.GetType().Name == "MusicFinishedEventArgs")
             {
                 if (MusicFinished != null)
                 {
                     MusicFinished(instance, (MusicFinishedEventArgs)ret);
                 }
             }
             else
             {
                 if (UserEvent != null)
                 {
                     UserEvent(instance, (UserEventArgs)ret);
                 }
             }
         }
         userEvents.Remove(e.UserCode);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Pushes a user-defined event on the event queue
        /// </summary>
        /// <remarks></remarks>
        /// <param name="userEventArgs">
        /// An opaque object representing a user-defined event.
        /// Will be passed back to the UserEvent handler delegate when this event is processed.
        /// </param>
        public static void PushUserEvent(UserEventArgs userEventArgs)
        {
            if (userEventArgs == null)
            {
                throw new ArgumentNullException("userEventArgs");
            }

            lock (instance)
            {
                userEvents[userEventId] = userEventArgs;
                userEventArgs.UserCode = userEventId;
                userEventId++;
            }

            Sdl.SDL_Event evt = userEventArgs.EventStruct;
            if (Sdl.SDL_PushEvent(out evt) != (int)SdlFlag.Success)
            {
                //throw SdlException.Generate();
            }
        }
Exemplo n.º 4
0
		void UserEvent (object sender, UserEventArgs args)
		{
			ReadyDelegate d = (ReadyDelegate)args.UserEvent;
			d ();
		}