Exemplo n.º 1
0
 public bool DeleteLoadout(LoadoutViewModel loadout)
 {
     return(ReorganizableCollectionUtilities <LoadoutViewModel> .Remove(
                Loadouts,
                loadout,
                x => SelectedLoadout == x,
                () => SelectedLoadout = null
                ));
 }
Exemplo n.º 2
0
 public bool MoveLoadoutDown(LoadoutViewModel loadout)
 {
     return(ReorganizableCollectionUtilities <LoadoutViewModel> .MoveDown(
                Loadouts,
                loadout,
                () => SelectedLoadout,
                x => SelectedLoadout = x
                ));
 }
Exemplo n.º 3
0
        public bool RenameLoadout(LoadoutViewModel loadoutViewModel)
        {
            var inputOptions = new InputOptions
            {
                WindowTitle        = $"Rename skill loadout",
                WindowPrompt       = $"Rename skill loadout '{loadoutViewModel.Name}'",
                WindowDefaultValue = loadoutViewModel.Name,
                IsInputMandatory   = true,
                IsValid            = x => Loadouts.Where(l => l != loadoutViewModel).All(l => l.Name != x)
            };

            if (InputUtils.Show(inputOptions, out string newName))
            {
                loadoutViewModel.Name = newName;
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        public bool RenameLoadout(LoadoutViewModel loadoutViewModel)
        {
            var renameOptions = new RenameOptions
            {
                WindowTitle        = $"Rename skill loadout",
                WindowPrompt       = $"Rename skill loadout '{loadoutViewModel.Name}'",
                WindowDefaultValue = loadoutViewModel.Name,
                IsInputMandatory   = true,
                IsValid            = x => Loadouts.Where(l => l != loadoutViewModel).All(l => l.Name != x)
            };

            if (ServicesContainer.GetService <IRenameService>().Rename(renameOptions, out string newName))
            {
                loadoutViewModel.Name = newName;
                return(true);
            }

            return(false);
        }