Beispiel #1
0
        private void InstallModsFromDialog()
        {
            var dialog = new System.Windows.Forms.OpenFileDialog();

            dialog.Title = "Select the packed mod(s) for installing.";
            var result = dialog.ShowDialog();

            if (result != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            var files = dialog.FileNames;

            var extractor = new ModExtracter();
            var extracted = extractor.Unpack(files);

            LoadAllMods();

            if (extracted.Count > 0)
            {
                MessageBox.Show("Extracted mods: " + String.Join(", ", extracted.ToArray()));
            }
            else
            {
                MessageBox.Show("No mods extracted (either the archive did not contain any mods, or they are already installed.");
            }
        }
        public ModDatabaseModViewModel(ModDatabaseMod mod, ModDatabase database)
        {
            this.mod = mod;
            this.timer = new Timer();
            this.database = database;
            this.saver = new DownloadedModSaver();
            this.extractor = new ModExtracter();

            DownloadModCommand = new Command(DownloadMod, x => !IsDownloading);

            timer.AutoReset = false;
            timer.Elapsed += (o, e) =>
            {
                ModHasBeenDownloaded = false;
                timer.Stop();
            };
            timer.Interval = TimeSpan.FromSeconds(5).TotalMilliseconds;
        }
Beispiel #3
0
        public ModDatabaseModViewModel(ModDatabaseMod mod, ModDatabase database)
        {
            this.mod       = mod;
            this.timer     = new Timer();
            this.database  = database;
            this.saver     = new DownloadedModSaver();
            this.extractor = new ModExtracter();

            DownloadModCommand = new Command(DownloadMod, x => !IsDownloading);

            timer.AutoReset = false;
            timer.Elapsed  += (o, e) =>
            {
                ModHasBeenDownloaded = false;
                timer.Stop();
            };
            timer.Interval = TimeSpan.FromSeconds(5).TotalMilliseconds;
        }
        private void InstallModsFromDialog()
        {
            var dialog = new System.Windows.Forms.OpenFileDialog();
            dialog.Title = "Select the packed mod(s) for installing.";
            var result = dialog.ShowDialog();

            if (result != System.Windows.Forms.DialogResult.OK)
                return;

            var files = dialog.FileNames;

            var extractor = new ModExtracter();
            var extracted = extractor.Unpack(files);

            LoadAllMods();

            if (extracted.Count > 0)
            {
                MessageBox.Show("Extracted mods: " + String.Join(", ", extracted.ToArray()));
            }
            else
            {
                MessageBox.Show("No mods extracted (either the archive did not contain any mods, or they are already installed.");
            }
        }