//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } string s = pref.GetString("Path", out ok); if (ok) { m_path = s; } string[] sa = pref.GetStringArray("Ext", out ok); if (ok) { m_TargetExt.Exts = sa; } } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); }
// ******************************************************* public bool Save(string p = "") { bool ret = false; JsonPref pref = new JsonPref(); try { pref.SetInt("Rows", m_Rows); pref.SetInt("Cols", m_Cols); var colors = new object[Count]; for (int i = 0; i < Count; i++) { colors[i] = Items[i].AE_Color.ToJson(); } pref.SetObject("Colors", colors); if (p == "") { p = Path.GetFileNameWithoutExtension(Application.ExecutablePath); p = Path.Combine(Application.UserAppDataPath, p + "_color.json"); } ret = pref.Save(p); path = p; } catch { ret = false; } return(ret); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } string[] sa = pref.GetStringArray("Undo", out ok); if (ok) { UndoList = sa.ToList <string>(); } } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); m_navBar.Caption = this.Text; }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } } int w = this.ClientSize.Width - printInfoPanel1.Left * 2; if (printInfoPanel1.Width != w) { printInfoPanel1.Width = w; } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); printInfoPanel1.LoadHis(); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } bool[] wl = pref.GetBoolArray("WizLimit", out ok); if (ok) { this.LimitValues = wl; } string s = pref.GetString("PictureFolder", out ok); if (ok) { if (System.IO.Directory.Exists(s) == true) { wizPictureBox1.PicureFolderPath = s; } } } // this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } string s = pref.GetString("WatchFolder", out ok); if (ok) { WatchFolder = s; } bool iss = pref.GetBool("IsStartup", out ok); if (ok) { CbIsStartup.Checked = iss; IsStartup = iss; } } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } string fp = pref.GetString("FilePath", out ok); if (ok) { refrainSaveFile1.FilePath = fp; this.Text = refrainSaveFile1.FilePath; } } }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetPoint("Point", this.Location); pref.SetString("TargetDir", iconButtonList1.TargetDir); pref.SetSize("ButtonSize", iconButtonList1.ButtonSize); int[] cols = new int[3]; cols[0] = iconButtonList1.ForeColor.ToArgb(); cols[1] = iconButtonList1.BackColor.ToArgb(); pref.SetIntArray("Color", cols); pref.SetString("Font", iconButtonList1.Font.Name); pref.SetDouble("FontSize", (double)iconButtonList1.Font.Size); pref.SetInt("FontStyle", (int)iconButtonList1.Font.Style); pref.SetBool("RelativePath", iconButtonList1.RelativePath); pref.Save(); iconButtonList1.BackupStore(); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); string afx = ""; if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } afx = pref.GetString("Afx", out ok); if (ok == false) { afx = ""; } } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); m_ae.ListBox = edAfx; if (afx != "") { m_ae.AfxPath = afx; } GetCommand(System.Environment.GetCommandLineArgs()); }
//------------------------------------------------------------- private bool ImportExp(string s) { bool ret = false; JsonPref pref = new JsonPref(); if (pref.Load(s) == false) { return(ret); } bool ok = false; string[] sa = pref.GetStringArray("expStr", out ok); if (ok) { expStr = sa.ToList <string>(); } string[] sb = pref.GetStringArray("expCap", out ok); if (ok) { expCap = sb.ToList <string>(); listBox1.Items.Clear(); listBox1.Items.AddRange(sb); } return(ret); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } string s = pref.GetString("OutputPath", out ok); if (ok) { ffmpeg_ctrl1.OutputPath = s; } bool b = pref.GetBool("IsSameDir", out ok); if (ok) { ffmpeg_ctrl1.IsSameDir = b; } int v = pref.GetInt("CRF", out ok); if (ok) { ffmpeg_ctrl1.CRF = v; } v = pref.GetInt("JobCount", out ok); if (ok) { ffmpeg_ctrl1.JobCount = v; } b = pref.GetBool("IsDNxHD", out ok); if (ok) { ffmpeg_ctrl1.IsDNxHD = b; } v = pref.GetInt("DNxHD_STYLE", out ok); if (ok) { if (v < 0) { v = 0; } else if (v > 1) { v = 1; } ffmpeg_ctrl1.DNxHD_STYLE = (DNxHD_STYLE)v; } } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetPoint("Point", this.Location); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetPoint("Point", this.Location); pref.SetBoolArray("WizLimit", this.LimitValues); pref.SetString("PictureFolder", wizPictureBox1.PicureFolderPath); pref.Save(); }
//******************************************************************** public void SavePref() { JsonPref pref = new JsonPref("pf"); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetInt("pv_now", (int)pv_now); pref.Save(); }
//------------------------------------------------------------- private bool ExportExp(string s) { bool ret = false; JsonPref pref = new JsonPref(); pref.SetStringArray("expStr", expStr.ToArray()); pref.SetStringArray("expCap", expCap.ToArray()); ret = pref.Save(s); return(ret); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetPoint("Point", this.Location); pref.SetString("FilePath", refrainSaveFile1.FilePath); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetStringArray("Undo", UndoList.ToArray()); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetString("Path", m_path); pref.SetStringArray("Ext", m_TargetExt.Exts); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetString("Afx", m_ae.AfxPath); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetIntArray("IntArray", new int[] { 8, 9, 7 }); pref.Save(); }
// ***************************************************************************************** private void Form1_Load(object sender, EventArgs e) { string filePath = Path.Combine(Application.UserAppDataPath, "AE_Effect.json"); if (File.Exists(filePath)) { aE_Effect1.Import(filePath); } else { string pp = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "AE_Effect.json"); if (File.Exists(pp)) { aE_Effect1.Import(pp); } else { MessageBox.Show("Please import AE_Effect.h"); } } JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } int sd = pref.GetInt("SplitDistance1", out ok); if (ok) { splitContainer1.SplitterDistance = sd; } sd = pref.GetInt("SplitDistance2", out ok); if (ok) { splitContainer2.SplitterDistance = sd; } sd = pref.GetInt("SplitDistance3", out ok); if (ok) { splitContainer3.SplitterDistance = sd; } } }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetString("WatchFolder", m_WatchFolder); pref.SetBool("IsStartup", m_IsStartup); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { listBox1.Items.Clear(); //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Size sz = pref.GetSize("Size", out ok); if (ok) { this.Size = sz; } Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } string exp = pref.GetString("ExportFile", out ok); if (ok) { ExportFile = exp; } if (File.Exists(ExportFile) == false) { string dd = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal); ExportFile = Path.Combine(dd, "expression.json"); } } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); string appName = Path.GetFileNameWithoutExtension(Application.ExecutablePath); string _filePath = Path.Combine(Application.UserAppDataPath, appName + "_exp.json"); string _exp = ExportFile; ImportExp(_filePath); _exp = ExportFile; if (listBox1.Items.Count <= 0) { AddExp("effect(\"open\")(1)"); AddExp("p = effect(\"open\")/100; \r\n if (p<0) {p=0;} else if (p>1){p=1;}\r\n"); AddExp("value * effect(\"open\") / 100"); AddExp("if (effect(\"open\")(1) <0){\r\n0;\r\n}else{\r\nvalue;\r\n}\r\n"); AddExp("v = value;\r\nv[0] *= p;\r\nv;\r\n"); AddExp("* Math.PI/180"); AddExp("Math.sin(r * Math.PI/180)"); AddExp("Math.cos(r * Math.PI/180)"); AddExp("Math.tan(r * Math.PI/180)"); } }
//-------------------------------------------------------------------------------------- public void PrefSave() { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetPoint("Point", this.Location); pref.SetInt("Height", this.Height); pref.SetIntArray("ParamsInt", tsGrid1.tsd.ParamsInt); pref.SetBoolArray("ParamsBool", tsGrid1.tsd.ParamsBool); pref.SetIntArray("Colors", tsGrid1.cols.ColorInt); pref.SetIntArray("Keys", tsGrid1.funcs.FuncTableAll); pref.Save(); }
private void button1_Click(object sender, EventArgs e) { JsonPref j = new JsonPref(); int[] aaa = new int[] { 78, 9, 12 }; double[] bbb = new double[] { 0.7, 0.01, 0.12 }; string[] ccc = new string[] { "eee", "sfskjbF", "13" }; j.SetIntArray("aa", aaa); j.SetDoubleArray("bb", bbb); j.SetStringArray("cc", ccc); MessageBox.Show(j.ToJson()); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetBool("IsFront", m_navBar.IsFront); pref.SetString("PalettePath", PalettePath); pref.SetBool("IsLocked", m_ColorBoxs.IsLocked); pref.SetBool("IsLocked2", lock2ToolStripMenuItem.Checked); pref.Save(); m_ColorBoxs.Save(); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetString("ExportFile", ExportFile); pref.Save(); string appName = Path.GetFileNameWithoutExtension(Application.ExecutablePath); string _filePath = Path.Combine(Application.UserAppDataPath, appName + "_exp.json"); ExportExp(_filePath); }
// ***************************************************************************************** private void Form1_FormClosed(object sender, FormClosedEventArgs e) { string filePath = Path.Combine(Application.UserAppDataPath, "AE_Effect.json"); aE_Effect1.Export(filePath); //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetInt("SplitDistance1", splitContainer1.SplitterDistance); pref.SetInt("SplitDistance2", splitContainer2.SplitterDistance); pref.SetInt("SplitDistance3", splitContainer3.SplitterDistance); pref.Save(); }
//------------------------------------------------------------- /// <summary> /// フォーム作成時に呼ばれる /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { //設定ファイルの読み込み JsonPref pref = new JsonPref(); if (pref.Load()) { bool ok = false; Point p = pref.GetPoint("Point", out ok); if (ok) { this.Location = p; } } this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath); }
//------------------------------------------------------------- /// <summary> /// フォームが閉じられた時 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_FormClosed(object sender, FormClosedEventArgs e) { //設定ファイルの保存 JsonPref pref = new JsonPref(); pref.SetSize("Size", this.Size); pref.SetPoint("Point", this.Location); pref.SetString("OutputPath", ffmpeg_ctrl1.OutputPath); pref.SetBool("IsSameDir", ffmpeg_ctrl1.IsSameDir); pref.SetInt("CRF", ffmpeg_ctrl1.CRF); pref.SetInt("JobCount", ffmpeg_ctrl1.JobCount); pref.SetBool("IsDNxHD", ffmpeg_ctrl1.IsDNxHD); pref.SetInt("DNxHD_STYLE", (int)ffmpeg_ctrl1.DNxHD_STYLE); pref.Save(); }