Example #1
0
 internal void prepareForDragAndDrop(DIcon dIconTemp)
 {
     if (!dIconTemp.IsSelected)
     {
         select(dIconTemp);
     }
     //D&D
 }
Example #2
0
        internal void DIcon_PreviewMouseUp(DIcon dIcon, MouseButtonEventArgs e)
        {
            List <string> strs = new List <string>();

            foreach (DIcon it in gridMain.Children)
            {
                if (it.IsSelected)
                {
                    strs.Add(it.filename);
                }
            }
            myParent.DIcon_PreviewMouseUp(strs.ToArray(), e);
        }
Example #3
0
 public DIcon addNewIconToEnd(string filename)
 {
     if (isFileHidden(filename))
     {
         return(null);
     }
     for (int i = 0; i < wcount; i++)
     {
         for (int j = 0; j < hcount; j++)
         {
             if (items[i, j] == null)
             {
                 items[i, j] = new DIcon(this, filename, i, j);
                 gridMain.Children.Add(items[i, j]);
                 return(items[i, j]);
             }
         }
     }
     return(null);
 }
Example #4
0
        public DIcon placeIcon(DIcon icon)
        {
            if (icon.x < wcount && icon.x >= 0 && icon.y < hcount && icon.y >= 0)
            {
                if (items[icon.x, icon.y] != null)
                {
                    if (items[icon.x, icon.y].filename == icon.filename)
                    {
                        return(items[icon.x, icon.y]);
                    }
                }
            }
            var position = getNearestSpace(icon.x, icon.y);

            //Console.WriteLine("empty x:{0}-y:{1}", position.x, position.y);
            if (position == null)
            {
                return(null);
            }
            icon.setPosition(position.x, position.y);
            items[icon.x, icon.y] = icon;
            return(icon);
        }
Example #5
0
        internal void delete(string fullPath)
        {
            this.Dispatcher.Invoke((Action)(() =>
            {
                DIconPositionManager.deletePosition(fullPath);
                int temp = -1;

                for (int i = 0; i < gridMain.Children.Count; i++)
                {
                    if ((gridMain.Children[i] as DIcon).filename == fullPath)
                    {
                        temp = i;
                        break;
                    }
                }
                if (temp >= 0)
                {
                    DIcon deleted = gridMain.Children[temp] as DIcon;
                    gridMain.Children.RemoveAt(temp);
                    items[deleted.x, deleted.y] = null;
                }
                DIconPositionManager.savePositions();
            }));
        }
Example #6
0
 internal void selectAdd(DIcon dIconTemp)
 {
     dIconTemp.IsSelected = true;
 }
Example #7
0
 internal void select(DIcon dIconTemp)
 {
     selectAll(false);
     dIconTemp.IsSelected = true;
 }