I'm using a class defined in an external library that allows access to a generic save device.

This class has an event handler for when it aquired the device.

I can then use the device to save/load, providing the device has been aquired.


I want to write an extension method that will perform a given method on the device if it's been aquired, and if it hasn't it will aquire it then perform the given method.

A first attempt as below:
Code:
public delegate void PostAquireDeviceAction();
public static void AquireDevicePerformAction(this SaveDevice saveDevice, PostAquireDeviceAction callMethod)
{
    if (!saveDevice.HasValidStorageDevice)
    {
        saveDevice.PromptForDevice();

        saveDevice.DeviceSelected += (sender, eventargs) =>
        {
            callMethod();
        };
    }
    else
    {
        callMethod();
    }
}
The issue with this is after calling this method, if the device is aquired again, that method will get called again (since it's a handler for the event).

How can i get round this issue?