示例#1
0
 private static void SetClipboardElement(this ICopyPasteble element, bool cut)
 {
     if (cut)
         _clipboardElem = element.DeepCopyWithObjectId() as ICopyPasteble;
     else
         _clipboardElem = element.DeepCopy() as ICopyPasteble;
 }
示例#2
0
        public static void PasteElement(object sender, RoutedEventArgs e)
        {
            var mainWin = DesignerMainWindow.GetInstance();
            _currentMousePosition = mainWin.GetCurrentMousePosition();
            var pasted = _clipboardElem;
            pasted.SlideId = mainWin.GetCurrentSlideId();

            var pastedUI = pasted as UIElement;
            if (pastedUI == null) return;

            InkCanvas.SetTop(pastedUI, _currentMousePosition.Y);
            InkCanvas.SetLeft(pastedUI, _currentMousePosition.X);
            Panel.SetZIndex(pastedUI, mainWin.canMainCanvas.Children.Count);
            mainWin.canMainCanvas.Children.Add(pastedUI);

            var currentSlideNr = mainWin.GetCurrentSlideNr();
            mainWin.canMainCanvas.SaveAllSlideData(Practice.GetInstance().GetSlideByPosition(currentSlideNr));

            _clipboardElem = null;
        }