private void PatchFinished(ErrorCode error) { // Disable animation termito.AutoDisable = true; // Enable buttons btnPatch.Enabled = true; btnShowExtras.Enabled = true; if (error.IsValid()) { DoneDialog.ShowWindow(this); } else { MessageErrorDialog.Show(ErrorCode.UnknownError, this); } }
private void ExportTorrentFile(object sender, EventArgs e) { string output; InfoDialog.ShowWriteTorrent(this); using (SaveFileDialog outputDialog = new SaveFileDialog()) { outputDialog.AddExtension = true; outputDialog.CheckFileExists = false; outputDialog.CheckPathExists = true; outputDialog.DefaultExt = ".torrent"; outputDialog.DereferenceLinks = true; outputDialog.Filter = "Archivo Torrent|*.torrent"; outputDialog.ShowHelp = false; outputDialog.SupportMultiDottedExtensions = true; outputDialog.ValidateNames = true; outputDialog.OverwritePrompt = true; outputDialog.FileName = "Vademécum del mago.torrent"; if (outputDialog.ShowDialog(this) != DialogResult.OK) { return; } output = outputDialog.FileName; } ErrorCode result = FileChecker.CheckOutput(output, FileChecker.TorrentLength); if (!result.IsValid()) { MessageErrorDialog.Show(result, this); return; } using (Stream torrent = ResourcesManager.GetStream("Book.torrent")) using (Stream outputStream = new FileStream(output, FileMode.Create)) ExportStream(outputStream, torrent); }