void DefaultLayer_QueryBehaviorBegin(object sender, EventArgs e) { string Bordercolor = ColorPicker1.CurrentColor.ToString(); string Fillcolor = ColorPicker2.CurrentColor.ToString(); int size = 1; PenSize ps = cbx.SelectedItem as PenSize; if (ps != null) { size = ps.size; } mapGis.MainMap.BorderColorValue = Bordercolor; mapGis.MainMap.BorderWidth = size; mapGis.MainMap.FillColorValue = Fillcolor; }
void DefaultLayer_QueryBehaviorCompleted(QueryBehaviorEventArgs pQueryBehaviorEventArgs) { if (pQueryBehaviorEventArgs == null) { return; } checkedRadioButton.IsChecked = false; string Bordercolor = ColorPicker1.CurrentColor.ToString(); string Fillcolor = ColorPicker2.CurrentColor.ToString(); int size = 1; PenSize ps = cbx.SelectedItem as PenSize; if (ps != null) { size = ps.size; } //MapFunPortal.mapPortal.setDrawBorderColor(Bordercolor); //MapFunPortal.mapPortal.setDrawBorderWidth(size); //MapFunPortal.mapPortal.setFillColor(Fillcolor); Index++; switch (pQueryBehaviorEventArgs.QueryBehavior) { case QueryBehavior.Circle: var argsCircle = pQueryBehaviorEventArgs as CircleBehaviorEventArgs; if (argsCircle != null) { mapGis.DrawCircle(argsCircle.CenterPoint, argsCircle.Radius, "Circle" + Index.ToString(), null, null, Bordercolor, Fillcolor, size); } break; case QueryBehavior.Rectangle: var argsRectangle = pQueryBehaviorEventArgs as RectangleQueryBehaviorEventArgs; if (argsRectangle != null) { mapGis.DrawRectangle(argsRectangle.LeftTopPoint, argsRectangle.Width, argsRectangle.Height, "Rectangle" + Index.ToString(), null, null, Bordercolor, Fillcolor, size); } break; case QueryBehavior.Polygon: var argsPolygon = pQueryBehaviorEventArgs as PolygonQueryBehaviorEventArgs; if (argsPolygon != null) { mapGis.DrawPolygon(argsPolygon.Points, "Polygon" + Index.ToString(), null, null, Bordercolor, Fillcolor, size); } break; case QueryBehavior.Ellipse: var argsEllipse = pQueryBehaviorEventArgs as PolygonQueryBehaviorEventArgs; if (argsEllipse != null) { mapGis.DrawPolygon(argsEllipse.Points, "Ellipse" + Index.ToString(), null, null, Bordercolor, Fillcolor, size); } break; case QueryBehavior.Polyline: var argsPolyline = pQueryBehaviorEventArgs as PolygonQueryBehaviorEventArgs; if (argsPolyline != null) { mapGis.DrawPolyline(argsPolyline.Points, "Polyline" + Index.ToString(), null, null, Bordercolor, size); } break; case QueryBehavior.Arrow: var argsArrow = pQueryBehaviorEventArgs as PolygonQueryBehaviorEventArgs; if (argsArrow != null) { mapGis.DrawPolygon(argsArrow.Points, "Arrow" + Index.ToString(), null, null, Bordercolor, Fillcolor, size); } break; case QueryBehavior.Freehand: var argsFreehand = pQueryBehaviorEventArgs as PolygonQueryBehaviorEventArgs; if (argsFreehand != null) { mapGis.DrawPolyline(argsFreehand.Points, "Freehand" + Index.ToString(), null, null, Bordercolor, size); } break; case QueryBehavior.LineSegment: var argsLineSegment = pQueryBehaviorEventArgs as PolygonQueryBehaviorEventArgs; if (argsLineSegment != null) { mapGis.DrawPolyline(argsLineSegment.Points, "LineSegment" + Index.ToString(), null, null, Bordercolor, size); } break; case QueryBehavior.Triangle: var argsTriangle = pQueryBehaviorEventArgs as PolygonQueryBehaviorEventArgs; if (argsTriangle != null) { mapGis.DrawPolygon(argsTriangle.Points, "Triangle" + Index.ToString(), null, null, Bordercolor, Fillcolor, size); } break; } if (GraphicChange != null) { GraphicChange(true); } }