private void DetachSelected()
 {
     foreach (Point point in SelectedTiles.GetAll())
     {
         if (!SelectedTilesValue.ContainsKey(point))
         {
             // Not moved yet
             SelectedTilesValue[point] = Layer.Tiles[point.Y][point.X];
             RemoveTile(point);
         }
     }
 }
        public List <ushort> GetSelectedValues()
        {
            // Including temp selection
            List <ushort> selectedValues = new List <ushort>();

            foreach (Point point in SelectedTiles.GetAll())
            {
                if (TempSelectionDeselect && TempSelectionTiles.Contains(point))
                {
                    continue;
                }
                if (SelectedTilesValue.ContainsKey(point))
                {
                    selectedValues.Add(SelectedTilesValue[point]);
                }
                else
                {
                    // Not moved yet
                    selectedValues.Add(Layer.Tiles[point.Y][point.X]);
                }
            }
            foreach (Point point in TempSelectionTiles.GetAll())
            {
                if (SelectedTiles.Contains(point))
                {
                    continue;
                }
                selectedValues.Add(Layer.Tiles[point.Y][point.X]);
            }
            return(selectedValues);
        }