private void writeConfig() { Config con = new Arma_3_Parser.Config(); con.PBOPath = txtPboPath.Text; con.BinPath = txtBinPath.Text; con.CPPPath = txtCppPath.Text; con.SerialPath = txtSerialized.Text; con.OutputPath = txtOutputPath.Text; con.UnpackPath = txtBankRevPath.Text; con.ConvertPath = txtCfgConvertPath.Text; con.NotContainPartClass = txtNotContainPartClass.Text; con.ContainPartClass = txtContainPartClass.Text; con.HasDirectParent = txtHasDirectParent.Text; con.HasOneOfParent = txtHasParent.Text; con.AnyField = txtContainsFields.Text; con.DispField = txtDisplayFields.Text; IFormatter writer = new BinaryFormatter(); Stream file = new FileStream(txtConfigPath.Text, FileMode.Create, FileAccess.Write, FileShare.None); writer.Serialize(file, con); file.Close(); Log("Saved Config"); }
private void readConfig() { if (File.Exists(txtConfigPath.Text)) { Config con = new Arma_3_Parser.Config(); IFormatter reader = new BinaryFormatter(); Stream file = new FileStream(txtConfigPath.Text, FileMode.Open, FileAccess.Read, FileShare.Read); con = (Config)reader.Deserialize(file); file.Close(); txtPboPath.Text = con.PBOPath; txtBinPath.Text = con.BinPath; txtCppPath.Text = con.CPPPath; txtSerialized.Text = con.SerialPath; txtOutputPath.Text = con.OutputPath; txtBankRevPath.Text = con.UnpackPath; txtCfgConvertPath.Text = con.ConvertPath; txtNotContainPartClass.Text = con.NotContainPartClass; txtContainPartClass.Text = con.ContainPartClass; txtHasDirectParent.Text = con.HasDirectParent; txtHasParent.Text = con.HasOneOfParent; txtContainsFields.Text = con.AnyField; txtDisplayFields.Text = con.DispField; } else { initializeConfig(); readConfig(); } }