void DownloadMod(string[] args) { string link = args[0]; string fileName = (args.Length > 1) ? args[1] : "Filename.zip"; WebClient client = new WebClient(); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; client.DownloadFile(link, Path.Combine(AllFilesPath, fileName)); NewMod m = new NewMod(AllFilesPath + fileName, VisualCategories.ToArray()); m.ShowDialog(); if (m.DialogResult == DialogResult.OK) { ProcessMod(m.mod); } /* * data.mods.Add(m.mod); * data.Save(dataPath); * listBox1.Items.Add(m.mod.name);*/ //MessageBox.Show(Application.StartupPath); //MessageBox.Show(String.Join("-", args)); }
private void button1_Click(object sender, EventArgs e) { NewMod m = new NewMod(VisualCategories.ToArray()); m.extractPath = AllFilesPath; m.ShowDialog(); if (m.DialogResult == DialogResult.OK) { ProcessMod(m.mod); //checkedListBox1.SetItemChecked(indexMax, true); } }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { Mod mod = data.mods.Find(mo => mo.name == listBox1.Items[listBox1.SelectedIndex].ToString()); string oldName = mod.name; NewMod m = new NewMod(VisualCategories.ToArray(), true, mod); m.extractPath = AllFilesPath; m.ShowDialog(); if (m.DialogResult == DialogResult.OK) { data.mods.Remove(mod); listBox1.Items.Remove(oldName); data.mods.Add(m.mod); listBox1.Items.Add(m.mod.name); data.Save(dataPath); } GetModInfo(); }