protected override void HandleOldEditTool(CanvasEditToolChangedEventArgs args, OffsetEditTool2 oldEditTool) { CommandOutputService.WriteLine(LanguageService.FindResourceString(Constants.EditToolTip_EndText_Offset)); oldEditTool.FixedOffsetChanged -= EditTool_FixedOffsetChanged; oldEditTool.DrawObjectSelected -= EditTool_DrawObjectSelected; oldEditTool.OffsetApplied -= EditTool_OffsetApplied; }
protected override void HandleOldEditTool(CanvasEditToolChangedEventArgs args, AngleMeasureEditTool oldEditTool) { if (oldEditTool != null) { oldEditTool.FirstMouseDownPositionConfirmed -= NewEditTool_FirstMouseDownPositionConfirmed; oldEditTool.SecondMouseDownPositionConfirmed -= NewEditTool_SecondMouseDownPositionConfirmed; oldEditTool.AngleCreated -= NewEditTool_AngleCreated; } CommandOutputService.WriteLine(LanguageService.FindResourceString(EditToolTip_EndText_AngleMeasure)); }
public void Handle(CanvasEditToolChangedEventArgs args) { if (args.EventArgs.OldValue is TEditTool oldEditTool) { HandleOldEditTool(args, oldEditTool); } if (args.EventArgs.NewValue is TEditTool newEditTool) { HandleNewEditTool(args, newEditTool); } }
private void EditTool_Loaded(CanvasEditToolChangedEventArgs args) { var metaData = _mefEditToolProviders.FirstOrDefault(p => p.Value.ValidateFromThis(args.EventArgs.NewValue))?.Metadata; if (metaData != null) { Text = _statusBarText_CurrentEditTool + LanguageService.FindResourceString(metaData.EditToolLanguageKey); } else { Text = _statusBarText_CurrentEditTool; } }
public void Handle(CanvasEditToolChangedEventArgs args) { var newEditTool = args.EventArgs.NewValue; var oldEditTool = args.EventArgs.OldValue; if (newEditTool != null) { newEditTool.CanvasPreviewMouseDown += EditTool_CanvasPreviewMouseDown; } if (oldEditTool != null) { oldEditTool.CanvasPreviewMouseDown -= EditTool_CanvasPreviewMouseDown; } }
protected override void HandleOldEditTool(CanvasEditToolChangedEventArgs args, CopyEditTool oldEditTool) { CommandOutputService.WriteLine(LanguageService.FindResourceString(Constants.EditToolTip_EndText_Copy)); }
private void CanvasEditToolChanged(CanvasEditToolChangedEventArgs e) { _commitEditCommand.RaiseCanExecuteChanged(); }
/// <summary> /// 当当前工具变更为复制工具后,进行对应的UI响应(输出响应等); /// </summary> protected override void HandleNewEditTool(CanvasEditToolChangedEventArgs args, MoveEditTool newEditTool) { CommandOutputService.WriteLine(LanguageService.FindResourceString(Constants.EditToolTip_BeginText_Move)); }
/// <summary> /// 处理旧的编辑工具; /// </summary> /// <param name="args"></param> /// <param name="oldEditTool"></param> protected abstract void HandleOldEditTool(CanvasEditToolChangedEventArgs args, TEditTool oldEditTool);