public static Task<List<string>> LoadForestServersAsync()
{
if (ADDiscoverForestServers.ForestServers != null)
return Task.FromResult(ADDiscoverForestServers.ForestServers);
ScheduledTaskStatus status;
lock (_scheduleLock)
{
if (ADDiscoverForestServers.ForestServers != null)
return Task.FromResult(ADDiscoverForestServers.ForestServers);
status = ADDiscoverForestServers.ScheduleNow();
}
return status.CompletionTask.ContinueWith(t =>
{
return ADDiscoverForestServers.ForestServers;
});
}