protected virtual void OnUserEvent(SwimUserEventArgs e) { if (updateEvent == null) { return; } updateEvent(this, e); Console.WriteLine("Update Event called"); }
///////////////////////////////////////////////////////////////// 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 }); } }
public void AddEventPartObserver(EventPartDTO ev) { SwimUserEventArgs userArgs = new SwimUserEventArgs(SwimUserEvent.AddEventPart, ev); OnUserEvent(userArgs); }
public void AddParticipantObserver(Participant part) { SwimUserEventArgs userArgs = new SwimUserEventArgs(SwimUserEvent.AddParticipant, part); OnUserEvent(userArgs); }