internal void prepareForDragAndDrop(DIcon dIconTemp) { if (!dIconTemp.IsSelected) { select(dIconTemp); } //D&D }
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); }
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); }
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); }
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(); })); }
internal void selectAdd(DIcon dIconTemp) { dIconTemp.IsSelected = true; }
internal void select(DIcon dIconTemp) { selectAll(false); dIconTemp.IsSelected = true; }