Esempio n. 1
0
        public async void OnDrop(ListBox listBox, DragEventArgs e)
        {
            string[] paths = e.Data.GetData(DataFormats.FileDrop) as string[];

            if (listBox.Name.StartsWith("Enabled"))
            {
                EnabledPacks.AddRange(await _resourcePackService.MoveLoadAllAsync(paths, true, IsCopy));
            }
            else
            {
                DisabledPacks.AddRange(await _resourcePackService.MoveLoadAllAsync(paths, false, IsCopy));
            }
        }
Esempio n. 2
0
        public async void AddNew()
        {
            var dialog = new Microsoft.Win32.OpenFileDialog()
            {
                Multiselect = true,
                Title       = _languageService.GetEntry("SelectResourcePacks"),
                Filter      = "Minecraft resourcepack | *.zip",
            };

            if (dialog.ShowDialog() ?? false)
            {
                DisabledPacks.AddRange(await _resourcePackService.MoveLoadAllAsync(dialog.FileNames, false, IsCopy));
            }
        }
Esempio n. 3
0
        public async void Reload()
        {
            EnabledPacks.Clear();
            DisabledPacks.Clear();

            foreach (var pack in await _resourcePackService.LoadAllAsync())
            {
                if (pack.IsEnabled)
                {
                    EnabledPacks.Add(pack);
                }
                else
                {
                    DisabledPacks.Add(pack);
                }
            }
        }
Esempio n. 4
0
 public void Disable(ResourcePack pack)
 {
     EnabledPacks.Remove(pack);
     pack.IsEnabled = false;
     DisabledPacks.Insert(0, pack);
 }
Esempio n. 5
0
 public void Enable(ResourcePack pack)
 {
     DisabledPacks.Remove(pack);
     pack.IsEnabled = true;
     EnabledPacks.Insert(0, pack);
 }
Esempio n. 6
0
        public void Delete(ResourcePack pack)
        {
            bool _ = (pack.IsEnabled) ? EnabledPacks.Remove(pack) : DisabledPacks.Remove(pack);

            _resourcePackService.DeleteFromDisk(pack);
        }