void reportResults(GraphicsLayerResult result) { if (!waitedForDoubleClick && !initiatedByTouch) { identifyTaskResults.Add(result); return; } if (doNotShowResults) { removeBusyIndicator(); return; } PendingIdentifies--; if (result != null && result.Results != null) { List <PopupItem> popupItems = PopupHelper.GetPopupItems(result.Results, result.Layer); popupItems.ForEach(p => _popupInfo.PopupItems.Add(p)); } removeBusyIndicator(); if (_popupInfo.PopupItems.Count > 0) { if (_popupInfo.SelectedIndex < 0) { _popupInfo.SelectedIndex = 0; } PopupHelper.ShowPopup(_popupInfo, clickPoint); } }
void doubleClickTimer_Tick(object sender, EventArgs e) { doubleClickTimer.Stop(); waitedForDoubleClick = true; // Initialize layer containing activity indicator to display on the map while results are // being retrieved. Only add the activity indicator if there are outstanding identify // operations and no results have been returned yet. if (PendingIdentifies > 0 && (identifyTaskResults == null || identifyTaskResults.Count == 0)) { if (busyLayer == null) { initializeBusyLayer(); } else { busyLayer.Graphics[0].Geometry = clickPoint; } if (!Map.Layers.Contains(busyLayer)) { Map.Layers.Add(busyLayer); } } if (identifyTaskResults != null && identifyTaskResults.Count > 0) { foreach (object item in identifyTaskResults) { IdentifyEventArgs args = item as IdentifyEventArgs; if (args != null) { reportResults(args); } else { GraphicsLayerResult result = item as GraphicsLayerResult; if (result != null) { reportResults(result); } } } } }