Beispiel #1
0
        public Task <CommandResult> InvokeAsync()
        {
            try {
                var data = PlotClipboardData.Serialize(new PlotClipboardData(VisualComponent.Device.DeviceId, VisualComponent.Device.ActivePlot.PlotId, _cut));
                Clipboard.Clear();
                Clipboard.SetData(PlotClipboardData.Format, data);
            } catch (ExternalException ex) {
                InteractiveWorkflow.Shell.ShowErrorMessage(ex.Message);
            }

            return(Task.FromResult(CommandResult.Executed));
        }
Beispiel #2
0
 private void Image_MouseMove(object sender, MouseEventArgs e)
 {
     if (_dragSurface.IsMouseMoveStartingDrag(e))
     {
         var data = PlotClipboardData.Serialize(new PlotClipboardData(Model.Device.DeviceId, Model.Device.ActivePlot.PlotId, false));
         var obj  = new DataObject(PlotClipboardData.Format, data);
         DragDrop.DoDragDrop(this, obj, DragDropEffects.Copy | DragDropEffects.Move);
     }
     else
     {
         _dragSurface.MouseMove(e);
     }
 }
Beispiel #3
0
 private void HistoryListView_MouseMove(object sender, MouseEventArgs e)
 {
     if (_dragSurface.IsMouseMoveStartingDrag(e))
     {
         var entry = GetSourceListViewItem((DependencyObject)e.OriginalSource)?.DataContext as IRPlotHistoryEntryViewModel;
         if (entry != null)
         {
             var data = PlotClipboardData.Serialize(new PlotClipboardData(entry.Plot.ParentDevice.DeviceId, entry.Plot.PlotId, false));
             var obj  = new DataObject(PlotClipboardData.Format, data);
             DragDrop.DoDragDrop(HistoryListView, obj, DragDropEffects.Copy | DragDropEffects.Move);
             return;
         }
     }
     _dragSurface.MouseMove(e);
 }
        public Task InvokeAsync()
        {
            var selection = VisualComponent.SelectedPlot;

            if (selection != null)
            {
                try {
                    var data = PlotClipboardData.Serialize(new PlotClipboardData(selection.ParentDevice.DeviceId, selection.PlotId, _cut));
                    Clipboard.Clear();
                    Clipboard.SetData(PlotClipboardData.Format, data);
                } catch (ExternalException ex) {
                    InteractiveWorkflow.Shell.ShowErrorMessage(ex.Message);
                }
            }
            return(Task.CompletedTask);
        }
Beispiel #5
0
        public override Task InvokeAsync()
        {
            var selection = VisualComponent.SelectedPlots.ToList();

            if (selection.Count > 0)
            {
                try {
                    var data = selection.Select(p => PlotClipboardData.Serialize(new PlotClipboardData(p.ParentDevice.DeviceId, p.PlotId, _cut))).ToArray();
                    Clipboard.Clear();
                    Clipboard.SetData(PlotClipboardData.Format, data);
                } catch (ExternalException ex) {
                    InteractiveWorkflow.Shell.ShowErrorMessage(ex.Message);
                }
            }
            return(Task.CompletedTask);
        }