private void onSingleLayerLoad(Object sender, UploadStringCompletedEventArgs e) { COperResult rlt = this._vLayer.OnLoadLayer(e); if (rlt.OperResult) { this.flag = 0; this.iMSMap1.SetErrorText(""); successFlag = 1; } }
//加载图层回调函数 private void onSingleLayerLoad(Object sender, UploadStringCompletedEventArgs e) { COperResult rlt = this._vLayer.OnLoadLayer(e); if (rlt.OperResult) { this.BufferArr.Add(this._vLayer); this.successFlag = true; this.iMSMap1.SetErrorText(""); } }
/** * 缓冲区分析回调函数 */ private void onSubmit(object sender, UploadStringCompletedEventArgs e) { if (this.buffer.IsEnabled) { return; } COperResult Rlt = this._spatial.OnBufferByGeometry(e); showRlt(Rlt); cancel(); }
//缓冲分析结果回调函数 private void getBufferFeature(Object sender, UploadStringCompletedEventArgs e) { if (this.successFlag == false) { COperResult obj = this.mapDoc.OnBufferFeature(e); if (obj.OperResult) { string svAddress = this.mapDoc.ServerAddress; //显示缓冲分析后的图层 showBufferInfo(bufferName, XClsType.SFeatureCls, svAddress); } } }
private void GetAddOperResult(object sender, UploadStringCompletedEventArgs e) { COperResult rlt = ActiveMapDoc.OnAddFeature(e); if (rlt.OperResult == true) { MessageBox.Show("添加成功", "提示", MessageBoxButton.OK); this.Close(); ActiveMapDoc.MapContainer.OperType = IMSOperType.Refresh; //this.m_activeMapDoc.Refresh(); } else { MessageBox.Show("添加失败,错误信息:" + rlt.ErrorInfo, "提示", MessageBoxButton.OK); } }
public void OnSetAllEnumLayerStatusCallBack(object sender, UploadStringCompletedEventArgs e) { COperResult operRlt = this._vLayer.OnSetAllEnumLayerStatus(e); if (operRlt.OperResult) { CLayerSelectParam layerSelectParam = new CLayerSelectParam(); layerSelectParam.PageCount = 0; layerSelectParam.WebSelectParam = new CWebSelectParam(); layerSelectParam.WebSelectParam.SelectionType = SelectionType.Condition; layerSelectParam.WebSelectParam.WhereClause = ""; _lastSelectParam = layerSelectParam; this._vLayer.LayerSelectAndGetAtt(layerSelectParam, new UploadStringCompletedEventHandler(SelectCallback)); } else { MessageBox.Show(operRlt.ErrorInfo); } }
public void showRlt(COperResult Rlt) { if (Rlt == null) { return; } if (Rlt.OperResult) { //Alert.yesLabel = "查看结果"; //Alert.noLabel = "取消"; if (MessageBox.Show("缓冲区分析成功。是否需要查看结果图层属性记录?", "缓冲区分析成功", MessageBoxButton.OKCancel) == MessageBoxResult.OK)//"提示",Alert.YES|Alert.NO , this , onAlert , null , Alert.NO); { showLayer(); } } else { MessageBox.Show("缓冲区分析失败。错误信息:" + Rlt.ErrorInfo); } }
public void OnSetStyle(object sender, UploadStringCompletedEventArgs e) { try { COperResult rlt = this.IMSCatalog.ActiveLayerObj.OnSetLayerDisplayStyle(e); if (rlt.OperResult) { if (MessageBox.Show("操作成功,您可以更新地图以应用新的设置。\n点击【确定】立即关闭本窗口。", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { this.Close(); } } else { MessageBox.Show("操作失败。" + rlt.ErrorInfo); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 删除完毕回调 /// </summary> private void OnDeleteFeature(object sender, UploadStringCompletedEventArgs e) { COperResult rlt = m_catalog.ActiveMapDoc.OnDeleteFeature(e); if (rlt.OperResult == true) { MessageBox.Show("删除成功", "提示", MessageBoxButton.OK); if (m_lastSelDataGrid != null && m_lastSelItem != null && m_lastSelDataGrid.ItemsSource is List <BindClass> ) { (m_lastSelDataGrid.ItemsSource as List <BindClass>).Remove(m_lastSelItem); IEnumerable ie = m_lastSelDataGrid.ItemsSource; m_lastSelDataGrid.ItemsSource = null; m_lastSelDataGrid.ItemsSource = ie; } //m_catalog.ActiveMapDoc.Refresh(); m_catalog.ActiveMapDoc.MapContainer.OperType = IMSOperType.Refresh; } else { MessageBox.Show("删除失败,错误信息:" + rlt.ErrorInfo, "提示", MessageBoxButton.OK); } m_lastSelDataGrid = null; m_lastSelItem = null; }
private void OnSubmit(object sender, UploadStringCompletedEventArgs e) { ClearRoad(); roadReslut.Blocks.Clear(); if (e.Error != null) { MessageBox.Show("分析失败,错误原因为:" + e.Error.Message, "提示", MessageBoxButton.OK); return; } try { if (e.Result.IndexOf("COperResult") > -1) { COperResult res = VectorObj.GetObject(e, typeof(COperResult)) as COperResult; MessageBox.Show(res.ErrorInfo, "提示", MessageBoxButton.OK); return; } CPathAnalyzeResult obj = _spatial.OnNetAnalyse(e); if (obj == null || obj.Paths == null) { return; } CNetPath path = obj.Paths[0]; int edgeNum = path.Edges.Length; Paragraph myParagraph = new Paragraph(); myParagraph.Inlines.Add(new Run() { Text = "1.从起点出发" }); Bold bold; IMSMark mark; StackPanel panel; for (int i = 0; i < edgeNum; i++) { CNetEdge edge = path.Edges[i]; if (i != 0) { myParagraph.Inlines.Add(new Run() { Text = (i + 1).ToString() + "." }); } myParagraph.Inlines.Add(new Run() { Text = "经" }); bold = new Bold() { Foreground = new SolidColorBrush(Colors.Red) }; bold.Inlines.Add(edge.FieldValus[2]); myParagraph.Inlines.Add(bold); if (i != edgeNum - 1) { myParagraph.Inlines.Add(new Run() { Text = "到达" }); bold = new Bold() { Foreground = new SolidColorBrush(Colors.Red) }; bold.Inlines.Add(path.Nodes[i + 1].FieldValus[0] + "\n"); myParagraph.Inlines.Add(bold); } else { myParagraph.Inlines.Add(new Run() { Text = "到达终点" }); } if (GraphicsLayer != null) { if (m_road == null) { m_road = new IMSPolyline(CoordinateType.Logic); m_road.Shape.Stroke = new SolidColorBrush(Colors.Red); GraphicsLayer.AddGraphics(m_road); } for (int j = 0; j < edge.Dots.Length; j++) { m_road.Points.Add(new Point(edge.Dots[j].x, edge.Dots[j].y)); } panel = new StackPanel() { Orientation = Orientation.Horizontal }; panel.Children.Add(new Image() { Source = new BitmapImage(new Uri("../images/bus/stop.png", UriKind.Relative)) }); panel.Children.Add(new TextBlock() { Text = edge.FieldValus[2] }); mark = new IMSMark(panel, CoordinateType.Logic, MarkLayer) { EnableAnimation = false, EnableDrag = false }; mark.X = edge.Dots[edge.Dots.Length / 2].x; mark.Y = edge.Dots[edge.Dots.Length / 2].y; MarkLayer.AddMark(mark); m_stopList.Add(mark); } } m_road.Draw(); roadReslut.Blocks.Add(myParagraph); radioButton1.IsChecked = false; radioButton2.IsChecked = false; } catch (Exception ex) { MessageBox.Show(ex.Message, "提示", MessageBoxButton.OK); } }