public static void addShortcut(BoxFile _boxFile, string _groupName) { _boxFile.Key = BoxFileData.getUniqueKey(_boxFile.Name); if (existShortcut(_boxFile.Key, _groupName)) { return; } var data = BoxFileData.STATIC_Shortcuts.Where(o => o.Key.Key == BoxFileData.getUniqueKey(_groupName)).FirstOrDefault(); var boxGroup = data.Key; var boxFiles = data.Value; if (boxFiles == null) { BoxFileData.STATIC_Shortcuts.Remove(boxGroup); boxFiles = new List <BoxFile>(); boxFiles.Add(_boxFile); BoxFileData.STATIC_Shortcuts.Add(boxGroup, boxFiles); } else { boxFiles.Add(_boxFile); } BoxFileData.SaveShortcut(); }
public static void deleteBoxGroup(string oldGroupName) { var data = BoxFileData.STATIC_Shortcuts.Where(o => o.Key.Key == BoxFileData.getUniqueKey(oldGroupName)).FirstOrDefault(); var oldBoxGroup = data.Key; BoxFileData.STATIC_Shortcuts.Remove(oldBoxGroup); BoxFileData.SaveShortcut(); }
public static void addBoxGroup(string _groupName) { BoxFileData.STATIC_Shortcuts.Add(new BoxGroup() { Key = BoxFileData.getUniqueKey(_groupName), Name = _groupName }, null); BoxFileData.SaveShortcut(); }
public static void updateShortcut(string _fileKey, string name, string _groupName) { if (!existShortcut(_fileKey, _groupName)) { return; } var data = BoxFileData.STATIC_Shortcuts.Where(o => o.Key.Key == BoxFileData.getUniqueKey(_groupName)).FirstOrDefault(); var _boxFile = data.Value.Where(o => o.Key == _fileKey).FirstOrDefault(); _boxFile.Name = name; BoxFileData.SaveShortcut(); }
public static void updateShortcut(string _fileKey, Bitmap largeIcon, Bitmap smallIcon, string _groupName) { if (!existShortcut(_fileKey, _groupName)) { return; } var data = BoxFileData.STATIC_Shortcuts.Where(o => o.Key.Key == BoxFileData.getUniqueKey(_groupName)).FirstOrDefault(); var _boxFile = data.Value.Where(o => o.Key == _fileKey).FirstOrDefault(); _boxFile.LargeIcon = largeIcon; _boxFile.SmallIcon = smallIcon; BoxFileData.SaveShortcut(); }
public static void updateBoxGroup(string oldGroupName, string newGroupName) { var data = BoxFileData.STATIC_Shortcuts.Where(o => o.Key.Key == BoxFileData.getUniqueKey(oldGroupName)).FirstOrDefault(); var oldBoxGroup = data.Key; var newBoxGroup = new BoxGroup() { Key = BoxFileData.getUniqueKey(newGroupName), Name = newGroupName }; var newBoxFileItems = data.Value; BoxFileData.STATIC_Shortcuts.Remove(oldBoxGroup); BoxFileData.STATIC_Shortcuts.Add(newBoxGroup, newBoxFileItems); BoxFileData.SaveShortcut(); }