public static void RemoveChild(ShortcutItem item) { Tile parent = (item.Parent as Tile); parent.Remove(item); foreach (ShortcutsSaveData shortcutitem in ShortcutItems) { if (shortcutitem.item == item) { ShortcutItems.Remove(shortcutitem); break; } } Data.SaveShortcuts(ShortcutItems); }
private void Tile_Drop(object sender, DragEventArgs e) { string[] Files = (string[])e.Data.GetData(DataFormats.FileDrop, false); foreach (string File in Files) { ShortcutItem shortcutitem = new ShortcutItem(File) { Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(AppTheme.GetAnotherColor((sender as ScrollViewer).Background.ToString()))) }; if (!shortcutitem.IsThereisErrors) { Tile Tile = (sender as ScrollViewer).Content as Tile; Tile.Add(shortcutitem); ShortcutItems.Add(new ShortcutsSaveData(FindTileName(sender as ScrollViewer), shortcutitem)); } } Data.SaveShortcuts(ShortcutItems); }
public static List <ShortcutsSaveData> LoadShortcuts() { List <ShortcutsSaveData> shortcuts = new List <ShortcutsSaveData>(); if (File.Exists(SaveFiles.Location() + SaveFiles.ShortcutsFile)) { string[] lines = File.ReadAllLines(SaveFiles.Location() + SaveFiles.ShortcutsFile); foreach (string line in lines) { try { ShortcutItem app = new ShortcutItem(GetVariable("ShortCutLocation", line), GetVariable("ShortCutIcon", line)); app.FileName_beta.Text = GetVariable("Text", line); app.Parameters = GetVariable("Parameters", line); if (!app.IsThereisErrors) { shortcuts.Add(new ShortcutsSaveData(GetVariable("Group", line), app)); } } catch (Exception) { } } } return(shortcuts); }
public ShortcutsSaveData(string ParentTile, ShortcutItem item) { this.ParentTile = ParentTile; this.item = item; }