void WriteInstallData() { var path = Path.Combine(installPanel1.InstallDirectory, "PPD\\install.info"); var installedInfo = new Dictionary <string, bool>(); foreach (string key in InstallInfo.InstallationInfoData) { installedInfo.Add(key, false); } try { if (File.Exists(path)) { using (StreamReader reader = new StreamReader(path)) { var setting = new SettingReader(reader.ReadToEnd()); foreach (string key in InstallInfo.InstallationInfoData) { installedInfo[key] |= setting[key] == "1"; } } } foreach (string key in InstallInfo.InstallationInfoData) { installedInfo[key] |= confirmPanel1.InstallInfo.GetInstalled(key); } } catch (Exception e) { MessageBox.Show(e.Message); } try { var sw = new SettingWriter(path, false); foreach (KeyValuePair <string, bool> kvp in installedInfo) { sw.Write(kvp.Key, kvp.Value); } if (installComponentPanel1.PPDVersion != "") { sw.Write("PPDVersion", installComponentPanel1.PPDVersion); } if (installComponentPanel1.BMSTOPPDVersion != "") { sw.Write("BMSTOPPDVersion", installComponentPanel1.BMSTOPPDVersion); } if (installComponentPanel1.Effect2DEditorVersion != "") { sw.Write("Effect2DEditorVersion", installComponentPanel1.Effect2DEditorVersion); } sw.Write("InstallVersion", installComponentPanel1.InstallVersion); sw.Close(); } catch (Exception e) { MessageBox.Show(e.Message); } }
private void SaveConfig() { if (!File.Exists(iniFileName)) { File.Create(iniFileName).Close(); } var sr = new StreamReader(iniFileName); var setting = new SettingReader(sr.ReadToEnd()); sr.Close(); setting.ReplaceOrAdd("Language", langFileISO); setting.ReplaceOrAdd("WindowWidth", Width); setting.ReplaceOrAdd("WindowHeight", Height); setting.ReplaceOrAdd("WindowState", (int)WindowState); setting.ReplaceOrAdd("CanvasWidth", canvasDock.CanvasWidth); setting.ReplaceOrAdd("CanvasHeight", canvasDock.CanvasHeight); setting.ReplaceOrAdd("CanvasBackGround", (int)canvasDock.BackGroundMode); setting.ReplaceOrAdd("CanvasBackGroundColor", ColorTranslator.ToHtml(canvasDock.BackGroundColor)); setting.ReplaceOrAdd("CanvasBackGroundImage", canvasDock.BackImageFileName); setting.ReplaceOrAdd("Language", langFileISO); using (SettingWriter sw = new SettingWriter(iniFileName, false)) { foreach (KeyValuePair <string, string> kvp in setting.Dictionary) { sw.Write(kvp.Key, kvp.Value); } } using (StreamWriter sw = new StreamWriter(recentUsedFileName)) { foreach (ToolStripMenuItem tsmi in this.最近使用したファイルToolStripMenuItem.DropDownItems) { sw.WriteLine(tsmi.Text); } } }
private void SavePPDIni() { if (!File.Exists(ppdini)) { File.Create(ppdini).Close(); } var sr = new StreamReader(ppdini); var setting = new SettingReader(sr.ReadToEnd()); sr.Close(); setting.ReplaceOrAdd("multisample", MultiSample); setting.ReplaceOrAdd("d3d", 0); setting.ReplaceOrAdd("adjustgaptime", MonitorLatency); setting.ReplaceOrAdd("fontname", FontName); setting.ReplaceOrAdd("fontsize", FontSize); var size = textBox9.Text.Split(','); if (size.Length == 2 && int.TryParse(size[0], out int width) && int.TryParse(size[1], out int height)) { } else { width = 800; height = 450; } setting.ReplaceOrAdd("width", width); setting.ReplaceOrAdd("height", height); setting.ReplaceOrAdd("movielatency", MovieLatency); setting.ReplaceOrAdd("token", this.Token); setting.ReplaceOrAdd("tokensecret", this.TokenSecret); setting.ReplaceOrAdd("movieextensions", this.MovieExtensions); setting.ReplaceOrAdd("musicextensions", this.MusicExtensions); setting.ReplaceOrAdd("Language", langFileISO); setting.ReplaceOrAdd("textboxdisabled", TextBoxDisabled); setting.ReplaceOrAdd("drawsamecoloratsametimingdisabled", DrawSameColorAtSameTimingDisabled); setting.ReplaceOrAdd("fullscreen", FullScreen); setting.ReplaceOrAdd("allowedtousemuchmemory", AllowedToUseMuchMemory); setting.ReplaceOrAdd("drawconnectunderallmark", DrawConnectUnderAllMark); setting.ReplaceOrAdd("everyframepollingdisabled", EveryFramePollingDisabled); setting.ReplaceOrAdd("menumoviepreviewdisabled", MenuMoviePreviewDisabled); setting.ReplaceOrAdd("accurateinputsleeptime", AccurateInputSleepTime); setting.ReplaceOrAdd("runexpansion", RunExpansion); setting.ReplaceOrAdd("expansionwaitport", ExpansionWaitPort); setting.ReplaceOrAdd("autoadjustlatencydisabled", AutoAdjustLatencyDisabled); setting.ReplaceOrAdd("shaderdisabled", ShaderDisabled); setting.ReplaceOrAdd("fontscaledisabled", FontScaleDisabled); setting.ReplaceOrAdd("highresolutionimagedisabled", HighResolutionImageDisabled); var sw = new SettingWriter(ppdini, false); foreach (KeyValuePair <string, string> kvp in setting.Dictionary) { sw.Write(kvp.Key, kvp.Value); } sw.Close(); }
public void Save() { try { _settingWriter.Write(); } catch (Exception innerException) { throw new ConfigurationException(Type, innerException); } }
private void SaveSetting() { var sr = new StreamReader(iniFileName); var setting = new SettingReader(sr.ReadToEnd()); sr.Close(); setting.ReplaceOrAdd("Language", langFileISO); using (SettingWriter sw = new SettingWriter(iniFileName, false)) { foreach (KeyValuePair <string, string> kvp in setting.Dictionary) { sw.Write(kvp.Key, kvp.Value); } } }
void WriteFontName(string path) { if (File.Exists(path)) { var sr = new StreamReader(path); var setting = new SettingReader(sr.ReadToEnd()); sr.Close(); setting.ReplaceOrAdd("fontname", fontName); using (SettingWriter sw = new SettingWriter(path, false)) { foreach (KeyValuePair <string, string> kvp in setting.Dictionary) { sw.Write(kvp.Key, kvp.Value); } } } }
public bool SaveIni(SettingWriter sw) { dataGridView1_CurrentCellDirtyStateChanged(dataGridView1, EventArgs.Empty); floatreaddata(0, out float thumbtimestart); floatreaddata(1, out float thumbtimeend); floatreaddata(2, out float start); floatreaddata(3, out float end); stringreaddata(4, out string easy); stringreaddata(5, out string normal); stringreaddata(6, out string hard); stringreaddata(7, out string extreme); floatreaddata(8, out float bpm); stringreaddata(9, out string bpmstring); floatreaddata(10, out float left); floatreaddata(11, out float right); floatreaddata(12, out float top); floatreaddata(13, out float bottom); sw.Write("thumbtimestart", thumbtimestart); sw.Write("thumbtimeend", thumbtimeend); sw.Write("start", start); sw.Write("end", end); sw.Write("bpm", bpm); sw.Write("bpmstring", bpmstring); sw.Write("difficulty easy", easy); sw.Write("difficulty normal", normal); sw.Write("difficulty hard", hard); sw.Write("difficulty extreme", extreme); sw.Write("moviecutleft", left); sw.Write("moviecutright", right); sw.Write("moviecuttop", top); sw.Write("moviecutbottom", bottom); sw.Write("guid", guid.ToString()); sw.Write("authorname", PPDStaticSetting.AuthorName); sw.Write("latency", 0); return(true); }