示例#1
0
 protected virtual void OnUserEvent(SwimUserEventArgs e)
 {
     if (updateEvent == null)
     {
         return;
     }
     updateEvent(this, e);
     Console.WriteLine("Update Event called");
 }
示例#2
0
        /////////////////////////////////////////////////////////////////


        private void userUpdate(object sender, SwimUserEventArgs suea)
        {
            if (suea.UserEventType == SwimUserEvent.AddEventPart)
            {
                foreach (EventPartDTO ev in events)
                {
                    EventPartDTO x = (EventPartDTO)suea.Data;
                    if (ev.Distance == x.Distance && ev.Style == x.Style)
                    {
                        ev.CodPart = ev.CodPart + 1;
                        break;
                    }
                }
                dataGvParticipant.BeginInvoke(new UpdateDGViewEventCallback(this.UpdateObserverEvent), new Object[] { dataGvEvent, events });
            }
            if (suea.UserEventType == SwimUserEvent.AddParticipant)
            {
                participants.Add((Participant)suea.Data);
                dataGvParticipant.BeginInvoke(new UpdateDGViewPartCallback(this.UpdateObserverPart), new Object[] { dataGvParticipant, participants });
            }
        }
示例#3
0
        public void AddEventPartObserver(EventPartDTO ev)
        {
            SwimUserEventArgs userArgs = new SwimUserEventArgs(SwimUserEvent.AddEventPart, ev);

            OnUserEvent(userArgs);
        }
示例#4
0
        public void AddParticipantObserver(Participant part)
        {
            SwimUserEventArgs userArgs = new SwimUserEventArgs(SwimUserEvent.AddParticipant, part);

            OnUserEvent(userArgs);
        }