private void tryGetResourceForSdsCandidateUrl(Queue<string> candidateUrls, Filter filter, object userState)
 {
     if (candidateUrls == null || candidateUrls.Count < 1)
     {
         OnGetCatalogFailed(new ExceptionEventArgs(new Exception(Strings.ExceptionDoneTryingallCandidateURLs), userState));
         return;
     }
     string agsRestUrl = candidateUrls.Dequeue();
     server = new Server(agsRestUrl) { FilterForSpatialContent = (filter & Filter.SpatiallyEnabledResources) == Filter.SpatiallyEnabledResources };
     server.GetCatalogCompleted += (o, e) =>
     {
         OnGetCatalogCompleted(new GetCatalogCompletedEventArgs() { ChildResources = e.ChildResources, UserState = e.UserState });
     };
     server.GetCatalogFailed += (o, e) =>
     {
         tryGetResourceForSdsCandidateUrl(candidateUrls, filter, userState);
     };
     server.GetCatalog(userState);
 }
 private void getChildResourcesForServer(Resource parentResource, Filter filter, object userState)
 {
     server = new Server(parentResource.Url) { FilterForSpatialContent = (filter & Filter.SpatiallyEnabledResources) == Filter.SpatiallyEnabledResources };
     server.GetCatalogFailed += (o, e) =>
     {
         OnGetChildResourcesFailed(e);
     };
     server.GetCatalogCompleted += (o, e) =>
     {
         OnGetChildResourcesCompleted(new GetChildResourcesCompletedEventArgs() { ChildResources = e.ChildResources, UserState = e.UserState });
     };
     server.GetCatalog(userState);
 }