FlightStick.FlightStickRemoved Ereignis
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Signalisiert, wenn ein Flight Stick getrennt ist.
// Register
static event_token FlightStickRemoved(EventHandler<FlightStick> const& handler) const;
// Revoke with event_token
static void FlightStickRemoved(event_token const* cookie) const;
// Revoke with event_revoker
static FlightStick::FlightStickRemoved_revoker FlightStickRemoved(auto_revoke_t, EventHandler<FlightStick> const& handler) const;
public static event System.EventHandler<FlightStick> FlightStickRemoved;
function onFlightStickRemoved(eventArgs) { /* Your code */ }
Windows.Gaming.Input.FlightStick.addEventListener("flightstickremoved", onFlightStickRemoved);
Windows.Gaming.Input.FlightStick.removeEventListener("flightstickremoved", onFlightStickRemoved);
- or -
Windows.Gaming.Input.FlightStick.onflightstickremoved = onFlightStickRemoved;
Public Shared Custom Event FlightStickRemoved As EventHandler(Of FlightStick)
Ereignistyp
Hinweise
Im folgenden Beispiel wird die Verfolgung eines entfernten Flight Sticks beendet.
#include <algorithm>
#include <winrt/Windows.Gaming.Input.h>
using namespace winrt;
using namespace Windows::Gaming::Input;
...
std::vector<FlightStick> m_myFlightSticks;
...
FlightStick::FlightStickRemoved([this](IInspectable const& /* sender */, FlightStick const& args)
{
std::remove(m_myFlightSticks.begin(), m_myFlightSticks.end(), args);
});
FlightStick::FlightStickRemoved +=
ref new EventHandler<FlightStick^>([] (Platform::Object^, FlightStick^ args)
{
unsigned int indexRemoved;
// `myFlightSticks` is a `Vector<FlightStick^>` that contains the flight sticks that your game is tracking.
if (myFlightSticks->IndexOf(args, &indexRemoved))
{
myFlightSticks->RemoveAt(indexRemoved);
}
});