using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace CobXmlSupport { public partial class frmSettings : Form { private string UserTmp, CompanyTmp; private bool tmpChkNoNsRef; private bool tmpChkUniqueVars; private bool tmpChkUniqueAttrVars; private bool tmpChkUnique; private bool tmpChkWrap; private bool tmpChkValues; private bool tmpChkAnaTag; private bool tmpChkCountVars; private bool tmpShowTestBtns; private bool tmpBackupOwnCode; private string tmpTxtPrefix; private string tmpTxtExpPrefix; private string tmpTxtMaxOcc; private string txtLogVarNameTmp; private string txtLogVarSectTmp; public frmSettings() { InitializeComponent(); } public string LogPost { get { return txtLogPost.Text; } set { txtLogPost.Text = value; } } public string LogSection { get { return txtLogSection.Text; } set { txtLogSection.Text = value; } } public string UserName { get { return txtUserName.Text; } set { txtUserName.Text = value; } } public string CompanyName { get { return txtCompanyName.Text; } set { txtCompanyName.Text = value; } } public bool ChkCountVars { get { return chkCountVars.Checked; } set { chkCountVars.Checked = value; } } public bool ChkNoNsRef { get { return chkNoNsRef.Checked; } set { chkNoNsRef.Checked = value; } } public bool ChkUniqueVars { get { return chkUniqueVars.Checked; } set { chkUniqueVars.Checked = value; } } public bool ChkUniqueAttrVars { get { return chkUniqueAttrVars.Checked; } set { chkUniqueAttrVars.Checked = value; } } public bool ChkUnique { get { return chkUnique.Checked; } set { chkUnique.Checked = value; } } public bool ChkWrap { get { return chkWrap.Checked; } set { chkWrap.Checked = value; } } public bool ChkValues { get { return chkValues.Checked; } set { chkValues.Checked = value; } } public bool ChkAnaTag { get { return chkAnaTag.Checked; } set { chkAnaTag.Checked = value; } } public bool ChkShowTestbtns { get { return chkShowTestbtns.Checked; } set { chkShowTestbtns.Checked = value; } } public bool ChkBackupOwnCode { get { return chkBackupOwnCode.Checked; } set { chkBackupOwnCode.Checked = value; } } public string TxtMaxOcc { get { return txtMaxOcc.Text; } set { txtMaxOcc.Text = value; } } public string TxtPrefix { get { return txtPrefix.Text; } set { txtPrefix.Text = value; } } public string TxtExpPrefix { get { return txtExpPrefix.Text; } set { txtExpPrefix.Text = value; } } private void btnSave_Click(object sender, EventArgs e) { Properties.Settings.Default.AnaTag = chkAnaTag.Checked; Properties.Settings.Default.CountVars = chkCountVars.Checked; Properties.Settings.Default.MaxOcc = txtMaxOcc.Text; Properties.Settings.Default.NoNsRef = chkNoNsRef.Checked; Properties.Settings.Default.Prefix = txtPrefix.Text; Properties.Settings.Default.ExpPrefix = txtExpPrefix.Text; Properties.Settings.Default.Unique = chkUnique.Checked; Properties.Settings.Default.UniqueAttrVars = chkUniqueAttrVars.Checked; Properties.Settings.Default.UniqueVars = chkUniqueVars.Checked; Properties.Settings.Default.Values = chkValues.Checked; Properties.Settings.Default.Wrap = chkWrap.Checked; Properties.Settings.Default.ShowTestbtns= chkShowTestbtns.Checked; Properties.Settings.Default.BackupOwnCode = chkBackupOwnCode.Checked; Properties.Settings.Default.LogVarName = txtLogPost.Text; Properties.Settings.Default.LogSectName = txtLogSection.Text; Properties.Settings.Default.Save(); this.Close(); } private void frmSettings_Load(object sender, EventArgs e) { UserTmp = txtUserName.Text; CompanyTmp = txtCompanyName.Text; tmpChkNoNsRef = chkNoNsRef.Checked; tmpChkUniqueVars = chkUniqueVars.Checked; tmpChkUniqueAttrVars = chkUniqueAttrVars.Checked; tmpChkUnique = chkUnique.Checked; tmpChkWrap = chkWrap.Checked; tmpChkValues = chkValues.Checked; tmpChkAnaTag = chkAnaTag.Checked; tmpShowTestBtns = chkShowTestbtns.Checked; tmpBackupOwnCode = chkBackupOwnCode.Checked; tmpTxtPrefix = txtPrefix.Text; tmpTxtExpPrefix = txtExpPrefix.Text; tmpTxtMaxOcc = txtMaxOcc.Text; txtLogVarNameTmp = txtLogPost.Text ; txtLogVarSectTmp = txtLogSection.Text; tmpChkCountVars = chkCountVars.Checked; } private void btnCancel_Click(object sender, EventArgs e) { txtUserName.Text = UserTmp; txtCompanyName.Text = CompanyTmp; chkNoNsRef.Checked= tmpChkNoNsRef; chkUniqueVars.Checked= tmpChkUniqueVars; chkUniqueAttrVars.Checked= tmpChkUniqueAttrVars ; chkUnique.Checked= tmpChkUnique; chkWrap.Checked= tmpChkWrap; chkValues.Checked= tmpChkValues; chkAnaTag.Checked= tmpChkAnaTag; chkShowTestbtns.Checked = tmpShowTestBtns; chkBackupOwnCode.Checked = tmpBackupOwnCode; txtPrefix.Text = tmpTxtPrefix; txtExpPrefix.Text = tmpTxtExpPrefix; txtMaxOcc.Text = tmpTxtMaxOcc; txtLogPost.Text= txtLogVarNameTmp; txtLogSection.Text= txtLogVarSectTmp; chkCountVars.Checked = tmpChkCountVars; this.Close(); } } }