private void StatFilterAreas() { ICurrentRasterInteractiver inter = _session.SmartWindowManager.ActiveCanvasViewer as ICurrentRasterInteractiver; if (inter != null) { inter.StartAOIDrawing(GetPencilType(), (aoi, shape) => { string layerName = "System:StatArea"; ILabelLayer lyr = GetLabelLayer((_activeViewer as ICurrentRasterInteractiver), layerName, _fieldNames); if (lyr != null) { Dictionary <string, double> areas = StatArea(aoi, _filters); _layerName = layerName; //ApplyColor(lyr); //lyr.LabelDef.Fieldname = "面积(平方公里)"; ApplyColor(lyr); lyr.LabelDef.Fieldname = _fieldNames[1]; lyr.LabelDef.EnableLabeling = true; CodeCell.AgileMap.Core.Feature fet = null; try { fet = ToFeature(shape, areas.Values.ToArray()); } catch (Exception ex) { _session.PrintMessage(ex); } if (fet != null) { lyr.AddFeature(fet); AddFeatureToListView(fet); } } }); } }
void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { _session.PrintMessage(e.Exception); }