private void btnExport_Click(object sender, EventArgs e) { try { if (txtIdent.Text == "") // ? 未生成 { throw new FailedOperation("鍵を生成して下さい。"); } string keyFile = SaveLoadDialogs.SaveFile( "保存先の鍵ファイルを選択してください", "鍵:unreal-remo-key", Environment.GetFolderPath(Environment.SpecialFolder.Desktop), this.txtIdent.Text + ".unreal-remo-key" ); if (keyFile != null) { XNode root = new XNode("UnrealRemoco-Key"); root.children.Add(new XNode("Ident", this.txtIdent.Text)); root.children.Add(new XNode("Key", this.txtRaw.Text)); root.children.Add(new XNode("Hash", this.txtHash.Text)); root.save(keyFile); throw new Completed("鍵ファイルに保存しました。"); } } catch (Exception ex) { FailedOperation.caught(ex); } }
private void ファイルに保存AToolStripMenuItem_Click(object sender, EventArgs e) { this.mtEnabled = false; try { List <string> pl = new List <string>(); pl.Add("; きららプレイリスト"); pl.Add("; 空行と ; で始まる行は無視します。"); pl.Add("; エンコード = UTF-8"); for (int rowidx = 0; rowidx < plSheet.RowCount; rowidx++) { pl.Add(plSheetGetRow(rowidx).file); } string initDir = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string initLFile = "きららプレイリスト.krrpl"; if (Gnd.i.lastPlayListFile != "") { initDir = Path.GetDirectoryName(Gnd.i.lastPlayListFile); initLFile = Path.GetFileName(Gnd.i.lastPlayListFile); } string plFile = SaveLoadDialogs.SaveFile("プレイリストの保存先を選択してください", "きららプレイリスト:krrpl", initDir, initLFile); if (plFile != null) { plFile = FileTools.toFullPath(plFile); Gnd.i.lastPlayListFile = plFile; File.WriteAllLines(plFile, pl, Encoding.UTF8); MessageBox.Show( "プレイリストを保存しました。", "情報", MessageBoxButtons.OK, MessageBoxIcon.Information ); } } catch (Exception ex) { FailedOperation.caught(ex); } finally { this.mtEnabled = true; } }
private void BtnExport_Click(object sender, EventArgs e) { try { string destFile = TimeData.Now().GetSimpleString() + ".xml"; for (; ;) { destFile = SaveLoadDialogs.SaveFile("保存先の設定ファイルを入力してください", "設定:xml", GetSettingDir(), Path.GetFileName(destFile)); if (destFile != null) { #if false if (destFile.StartsWith("\\\\")) { MessageBox.Show( "ネットワークパスは使用できません。", "ファイル名に問題があります", MessageBoxButtons.OK, MessageBoxIcon.Warning ); continue; } if (JString.IsJString(destFile, true, false, false, true, false) == false) { MessageBox.Show( "Shift_JIS で表現出来ない文字は使用できません。", "ファイル名に問題があります", MessageBoxButtons.OK, MessageBoxIcon.Warning ); continue; } #endif this.DoExport(destFile); } break; } } catch (Exception ex) { MessageBox.Show( this, "" + ex, "エクスポートに失敗しました", MessageBoxButtons.OK, MessageBoxIcon.Warning ); } }
private void RecEnded() { if (Gnd.I.RecEndUnmin) { this.WindowState = FormWindowState.Normal; } string destFile = TimeData.Now().GetSimpleString() + ".bat"; for (; ;) { destFile = SaveLoadDialogs.SaveFile("保存先のバッチファイルを入力してください", "バッチ:bat", Gnd.I.OutDir, Path.GetFileName(destFile)); if (destFile != null) { if (destFile.StartsWith("\\\\")) { MessageBox.Show( "ネットワークパスは使用できません。", "ファイル名に問題があります", MessageBoxButtons.OK, MessageBoxIcon.Warning ); continue; } if (JString.IsJString(destFile, true, false, false, true, false) == false) { MessageBox.Show( "Shift_JIS で表現出来ない文字は使用できません。", "ファイル名に問題があります", MessageBoxButtons.OK, MessageBoxIcon.Warning ); continue; } Gnd.I.OutDir = Path.GetDirectoryName(destFile); this.SaveData(); // 設定反映!!! BusyDlg.Perform(delegate { new BatchConv(Gnd.I.RecFile, destFile).Perform(); }); } break; } }
private void 前を付けて保存AToolStripMenuItem_Click(object sender, EventArgs e) { this.mtEnabled = false; try { if (Gnd.i.md == null) { return; } string presetFile = Gnd.i.md.ed.getLastSavedFile(); //string presetFile = Gnd.i.md.getOriginalFile(); // old string selectedFile = SaveLoadDialogs.SaveFile( "保存先のファイルを選択してください", "", Path.GetDirectoryName(presetFile), Path.GetFileName(presetFile), dlg => { dlg.Filter = Gnd.i.movieExtensions.getFilter(); dlg.FilterIndex = Gnd.i.movieExtensions.indexOf(".mp4") + 1; }); if (selectedFile != null) { BusyDlg.perform(delegate { Gnd.i.md.ed.saveFile(selectedFile); }); } } catch (Exception ex) { FailedOperation.caught(ex); } refreshTitle(); this.mtEnabled = true; }