Select to view content in your preferred language

Bug in extension Pane.ActivateAndDelay(this Pane pane, int delay = 100)

31
0
6 hours ago
Asimov
by
New Contributor III

I discovered the bug on subject while working on an Addin where I needed such extension. Currently working on 3.2 SDK, the extension is located in the namespace ArcGIS.Desktop.Internal.Mapping.UtilityExtensions and is defined as follows:

 

public static Task ActivateAndDelay(this Pane pane, int delay = 100)
{
    if (pane != null)
    {
        pane.Activate();
        if (delay > 0)
        {
            return Task.Delay(100);
        }
    }

    return Task.CompletedTask;
}

 

The bug is pretty obvious: the parameter 'delay' is just ignored. Note that this bug also affects at least another extension, ActivateAndExecute(this Pane pane, Func<Task> function, int delay = 100), since it calls ActivateAndDelay().

Tags (3)
0 Kudos
0 Replies