private void Copy()
 {
     if (!(CurrentProject is ICopyPasteable))
     {
         Errorhandler.RaiseMessage("Could not copy in this project.", "Copy", Errorhandler.MessageType.Warning);
     }
     DisplaySettingsTool.ClearPastePositions();
     if (selectedDominoes.Count < 0)
     {
         Errorhandler.RaiseMessage("Nothing to copy!", "No selection", Errorhandler.MessageType.Error);
         return;
     }
     toCopy     = new List <int>(selectedDominoes);
     startindex = selectedDominoes.Min();
     ClearFullSelection(true);
     try
     {
         int[] validPositions = ((ICopyPasteable)this.CurrentProject).GetValidPastePositions(startindex);
         DisplaySettingsTool.HighlightPastePositions(validPositions);
     }
     catch (InvalidOperationException ex)
     {
         Errorhandler.RaiseMessage(ex.Message, "Error", Errorhandler.MessageType.Error);
     }
     UpdateUIElements();
 }
 private void Paste()
 {
     try
     {
         if (!(CurrentProject is ICopyPasteable))
         {
             Errorhandler.RaiseMessage("Could not paste in this project.", "Paste", Errorhandler.MessageType.Warning);
         }
         if (selectedDominoes.Count == 0)
         {
             return;
         }
         int pasteindex = selectedDominoes.First();
         RemoveFromSelectedDominoes(pasteindex);
         ClearFullSelection(true);
         PasteFilter paste = new PasteFilter(CurrentProject as ICopyPasteable, startindex, toCopy.ToArray(), pasteindex);
         paste.Apply();
         undoStack.Push(paste);
         DisplaySettingsTool.ClearPastePositions();
         UpdateUIElements();
     }
     catch (InvalidOperationException ex)
     {
         Errorhandler.RaiseMessage(ex.Message, "Error", Errorhandler.MessageType.Error);
     }
 }
 internal void ClearCanvas(bool ClearSelection = true)
 {
     DisplaySettingsTool.ClearPastePositions();
     if (ClearSelection)
     {
         ClearFullSelection(true);
     }
     if (DisplaySettingsTool.DominoProject != null)
     {
         DisplaySettingsTool.RemoveStones();
     }
 }