private void getInfoServer_ProcessCompleted(object sender , GetLayersInfoEventArgs e) { if (e.Result.LayersInfo.Count > 0) { foreach (var layer in e.Result.LayersInfo) { layersStatus.Add(new LayerStatus { IsVisible = layer.IsVisible , LayerName = layer.Name }); } layersList.ItemsSource = layersStatus; } }
private void layerServices_ProcessCompleted(object sender, GetLayersInfoEventArgs e) { if (e.Result != null && e.Result.LayersInfo != null) { ObservableCollection<LegendItemInfo> colls = new ObservableCollection<LegendItemInfo>(); foreach (var item in e.Result.LayersInfo) { LegendItemInfo info = new LayerLegendItemInfo(item, this.layer, sourceImageHeight, sourceImageWidth,IsExpanded); if (showOnlyVisibleLayers && !item.IsVisible) { continue; } colls.Add(info); } this.LayerItems = colls; DoUIRefresh(this); } }
private void Request_Completed(object sender, RequestEventArgs e) { //不做e.Error的判断 if (e.Result != null && !string.IsNullOrEmpty(e.Result)) { GetLayersInfoResult result = GetLayersInfoResult.FromJson(e.Result); lastResult = result; GetLayersInfoEventArgs args = new GetLayersInfoEventArgs(result, e.Result, e.UserState); OnProcessCompleted(args); } }
private void OnProcessCompleted(GetLayersInfoEventArgs e) { if (ProcessCompleted != null) { ProcessCompleted(this, e); } }