/// <summary> /// 活动地点右键 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void DefaultLayer_OnGraphicsMouseRightButtonUp(object sender, GraphicEventArgs e) { IDictionary <string, object> Dic = e.DC as IDictionary <string, object>; string ElementId = Dic["ElementId"] == null ? null : Dic["ElementId"].ToString(); #region 图形 if (e.QueryBehavior == QueryBehavior.Polygon || e.QueryBehavior == QueryBehavior.Polyline) { if (ElementId.StartsWith(MapGroupTypes.AreaRange_.ToString())) { Path p = sender as Path; if (p == null) { return; } //if (p.Tag == null) // p.Tag = GetSiteAreaId(ElementId); if (p.ContextMenu == null) { p.ContextMenu = GetAreaContextMenu(GetSiteAreaId(ElementId)); } } } #endregion }
private void OnGraphicComplete(object sender, GraphicEventArgs e) { _graphicBuilder.GraphicCancelled -= OnGraphicCancelled; _graphicBuilder.GraphicComplete -= OnGraphicComplete; _graphicBuilder = null; if (_primitiveGraphic != null) { bool boundingBoxTooSmall = false; _primitiveGraphic.CoordinateSystem = CoordinateSystem.Destination; if (_primitiveGraphic.BoundingBox.Width < 50 || _primitiveGraphic.BoundingBox.Height < 50) { boundingBoxTooSmall = true; } _primitiveGraphic.ResetCoordinateSystem(); if (boundingBoxTooSmall) { RemoveDrawShutterGraphic(); base.SelectedPresentationImage.Draw(); } else { GeometricShutter shutter = ConvertToGeometricShutter(); GeometricShuttersGraphic shuttersGraphic = GetGeometricShuttersGraphic((IDicomPresentationImage)base.SelectedPresentationImage, true); DrawableUndoableCommand command = new DrawableUndoableCommand(shuttersGraphic); command.Name = SR.CommandDrawShutter; command.Enqueue(new AddGeometricShutterUndoableCommand(shuttersGraphic, shutter)); command.Execute(); base.ImageViewer.CommandHistory.AddCommand(command); } } }
private void ViewModel_GraphicUpdated(object sender, GraphicEventArgs e) { Graphic GraphicToUpdate = (Graphic)e.graph; if (graphicRepresentationDictionary != null) { DrawGraphicsInList(GraphicToUpdate); } }
/// <summary> /// передать данные /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void manager_OnData(object sender, GraphicEventArgs e) { try { if (NShow) { if (_app != null) { Slice[] slices = _app.Commutator.GetDataFromBuffer(e.StartTime, e.FinishTime); if (slices != null) { graphic_glybina.Clear(); graphic_mehskorost.Clear(); graphic_vesnakruke.Clear(); graphic_davlenienaman.Clear(); graphic_rashodnavhode.Clear(); foreach (Slice slice in slices) { if (slice.slice != null) { int sliceLen = slice.slice.Length; if (_app.Technology.P0205.SNumber > -1 && _app.Technology.P0205.SNumber < sliceLen) { graphic_glybina.Insert(slice._date, slice[_app.Technology.P0205.SNumber]); } if (_app.Technology.P0208.SNumber > -1 && _app.Technology.P0208.SNumber < sliceLen) { graphic_mehskorost.Insert(slice._date, slice[_app.Technology.P0208.SNumber]); } if (_app.Technology.P0102.SNumber > -1 && _app.Technology.P0102.SNumber < sliceLen) { graphic_vesnakruke.Insert(slice._date, slice[_app.Technology.P0102.SNumber]); } if (_app.Technology.P0004.SNumber > -1 && _app.Technology.P0004.SNumber < sliceLen) { graphic_davlenienaman.Insert(slice._date, slice[_app.Technology.P0004.SNumber]); } if (_app.Technology.P0114.SNumber > -1 && _app.Technology.P0114.SNumber < sliceLen) { graphic_rashodnavhode.Insert(slice._date, slice[_app.Technology.P0114.SNumber]); } } } } } } } catch { } }
private void OnGraphicBuilderCancelled(object sender, GraphicEventArgs e) { _resliceToolGroup.ToolGroupState.SetMemento(_originalResliceToolsState); _originalResliceToolsState = null; RemoveGraphicBuilder(); this.ImageViewer.PhysicalWorkspace.Draw(); }
private void OnGraphicBuilderCancelled(object sender, GraphicEventArgs e) { _graphicBuilder.GraphicComplete -= OnGraphicBuilderComplete; _graphicBuilder.GraphicCancelled -= OnGraphicBuilderCancelled; _undoableCommand.Unexecute(); _undoableCommand = null; _graphicBuilder = null; }
private void OnGraphicBuilderComplete(object sender, GraphicEventArgs e) { _graphicBuilder.GraphicComplete -= OnGraphicBuilderComplete; _graphicBuilder.GraphicCancelled -= OnGraphicBuilderCancelled; _graphicBuilder.Graphic.ImageViewer.CommandHistory.AddCommand(_undoableCommand); _graphicBuilder.Graphic.Draw(); _undoableCommand = null; _graphicBuilder = null; }
private void OnGraphicBuilderComplete(object sender, GraphicEventArgs e) { _graphicBuilder.GraphicComplete -= OnGraphicBuilderComplete; _graphicBuilder.GraphicCancelled -= OnGraphicBuilderCancelled; _graphicBuilder.Graphic.ImageViewer.CommandHistory.AddCommand(_undoableCommand); _graphicBuilder.Graphic.Draw(); _undoableCommand = null; this.Active = true;//set the defaut is pan _graphicBuilder = null; }
/// <summary> /// Fired when the graphic builder is also done setting text in the graphic, and thus we can decide if we want to unexecute /// the insert or save the command into the history. /// </summary> private void OnGraphicFinalCancelled(object sender, GraphicEventArgs e) { InteractiveTextGraphicBuilder graphicBuilder = sender as InteractiveTextGraphicBuilder; if (graphicBuilder != null) { graphicBuilder.GraphicFinalComplete -= OnGraphicFinalComplete; graphicBuilder.GraphicFinalCancelled -= OnGraphicFinalCancelled; } _undoableCommand.Unexecute(); _undoableCommand = null; }
/// <summary> /// Fired when the graphic builder is also done setting text in the graphic, and thus we can decide if we want to unexecute /// the insert or save the command into the history. /// </summary> private void OnGraphicFinalComplete(object sender, GraphicEventArgs e) { // fired InteractiveTextGraphicBuilder graphicBuilder = sender as InteractiveTextGraphicBuilder; if (graphicBuilder != null) { graphicBuilder.GraphicFinalComplete -= OnGraphicFinalComplete; graphicBuilder.GraphicFinalCancelled -= OnGraphicFinalCancelled; } ImageViewer.CommandHistory.AddCommand(_undoableCommand); _undoableCommand = null; }
void DefaultLayer_OnGraphicsMouseLeftButtonUp(object sender, GraphicEventArgs e) { if (rbDel.IsChecked == true) { IDictionary <string, object> Dic = e.DC as IDictionary <string, object>; string ElementId = Dic["ElementId"] == null ? null : Dic["ElementId"].ToString(); if (!string.IsNullOrEmpty(ElementId)) { if (MessageBox.Show("是否要删除该图形?", "询问", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { mapGis.RemoveSymbolElement(ElementId); if (GraphicChange != null) { GraphicChange(true); } } } } rbDel.IsChecked = false; }
private void OnGraphicBuilderDone(object sender, GraphicEventArgs e) { if (base.ImageViewer.CommandHistory != null) { DrawableUndoableCommand compositeCommand = new DrawableUndoableCommand(this.ImageViewer.PhysicalWorkspace); compositeCommand.Name = SR.CommandMprReslice; MemorableUndoableCommand toolGroupStateCommand = new MemorableUndoableCommand(_resliceToolGroup.ToolGroupState); toolGroupStateCommand.BeginState = _originalResliceToolsState; toolGroupStateCommand.EndState = _resliceToolGroup.ToolGroupState.CreateMemento(); compositeCommand.Enqueue(toolGroupStateCommand); base.ImageViewer.CommandHistory.AddCommand(compositeCommand); } _originalResliceToolsState = null; RemoveGraphicBuilder(); _lastTopLeftPresentationImageIndex = this.SliceImageBox.TopLeftPresentationImageIndex; }
private void DrawingView_PlotAction(object sender, GraphicEventArgs e) { if (e.EventType == EventType.ResizePlot) { _model.ResizePlot(drawingView.graph); } else if (e.EventType == EventType.MovePlot && drawingView.graph.Cursor == Cursors.SizeAll) { _model.RefreshPlotByMoving(e.mouseLocation); } else if (e.EventType == EventType.AdpdateCurve) { try { _model.ApdateCurvesList(e.newCurve, e.Delete, e.NewName); InitCurvesNames(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if (e.EventType == EventType.AddNewCurve) { using (OpenFileDialog od = new OpenFileDialog()) { od.Filter = ".txt (*.txt)|*.txt"; if (od.ShowDialog() == DialogResult.Yes || od.FileName != "") { _model.LoadTXTData(od.FileName, e.SortValues); } } InitCurvesNames(); } else if (e.EventType == EventType.Zoom) { _model.ZoomPlot(e.Zoom); } }
/// <summary> /// Fired when the graphic builder is done placing the graphic, and hence does not need mouse capture anymore, but in the /// text graphic is not technically complete yet and thus we do not insert into the command history yet. /// </summary> private void OnGraphicBuilderInitiallyDone(object sender, GraphicEventArgs e) { _graphicBuilder.GraphicComplete -= OnGraphicBuilderInitiallyDone; _graphicBuilder.GraphicCancelled -= OnGraphicBuilderInitiallyDone; _graphicBuilder = null; }