Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Kabelou

Pages: [1]
1
DotNet / Delete an event ?
« on: April 01, 2020, 02:15:25 pm »
Hi,


I am creating a game with several methods that use the same events but with different attributes:

app.JoystickMoved += (s, e) => JoyMoved3(e.Axis, e.Position, app, s1, s2, s3, s4, s5, s6, r1, r2, r3, r4, r5, r6);

app.JoystickMoved += (s, e) => JoyMoved(e.Axis, e.Position, map);

I add in the events "JoystickMoved" a new event "JoyMoved3". But if I call my function which adds a new event "JoyMoved3" x times, it executes x times but I would like it to execute 1 time even if I call it 15 times.

I thought about that: (with minus)

app.JoystickMoved -= (s, e) => JoyMoved3(e.Axis, e.Position, app, s1, s2, s3, s4, s5, s6, r1, r2, r3, r4, r5, r6);

But it does not work.

How can I delete this event please ?


Thanks for any help and sorry for my bad english.

Pages: [1]