コード例 #1
0
 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;
 }
コード例 #2
0
 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));
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
        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;
            }
        }
コード例 #6
0
 protected override void HandleOldEditTool(CanvasEditToolChangedEventArgs args, CopyEditTool oldEditTool)
 {
     CommandOutputService.WriteLine(LanguageService.FindResourceString(Constants.EditToolTip_EndText_Copy));
 }
コード例 #7
0
 private void CanvasEditToolChanged(CanvasEditToolChangedEventArgs e)
 {
     _commitEditCommand.RaiseCanExecuteChanged();
 }
コード例 #8
0
 /// <summary>
 /// 当当前工具变更为复制工具后,进行对应的UI响应(输出响应等);
 /// </summary>
 protected override void HandleNewEditTool(CanvasEditToolChangedEventArgs args, MoveEditTool newEditTool)
 {
     CommandOutputService.WriteLine(LanguageService.FindResourceString(Constants.EditToolTip_BeginText_Move));
 }
コード例 #9
0
 /// <summary>
 /// 处理旧的编辑工具;
 /// </summary>
 /// <param name="args"></param>
 /// <param name="oldEditTool"></param>
 protected abstract void HandleOldEditTool(CanvasEditToolChangedEventArgs args, TEditTool oldEditTool);