Esempio n. 1
0
        public void RenamePreset(string newPresetName)
        {
            this.SelectedPreset.Preset.Name = newPresetName;

            // Remove from the folder and add it back again so it goes in the right place.
            PresetFolderViewModel currentFolder = this.FindFolderViewModel(this.SelectedPreset.Preset.FolderId);

            currentFolder.RemoveItem(this.SelectedPreset);
            currentFolder.AddItem(this.SelectedPreset);

            this.SavePreset();
        }
Esempio n. 2
0
        public void MovePresetToFolder(PresetViewModel presetViewModel, PresetFolderViewModel targetFolder)
        {
            PresetFolderViewModel previousFolder = this.FindFolderViewModel(presetViewModel.Preset.FolderId);

            previousFolder.RemoveItem(presetViewModel);

            targetFolder.AddItem(presetViewModel);
            presetViewModel.Preset.FolderId = targetFolder.Id;

            targetFolder.IsExpanded = true;

            this.SaveUserPresets();
        }
Esempio n. 3
0
        private bool RemovePresetFromFolder(PresetFolderViewModel folder, PresetViewModel presetViewModel)
        {
            if (folder.Items.Contains(presetViewModel))
            {
                folder.RemoveItem(presetViewModel);
                return(true);
            }

            foreach (var subFolder in folder.SubFolders)
            {
                if (this.RemovePresetFromFolder(subFolder, presetViewModel))
                {
                    return(true);
                }
            }

            return(false);
        }