проверка сохранения
This commit is contained in:
parent
f493dc1e7a
commit
659f7f12e9
|
|
@ -21,7 +21,7 @@ namespace Reseter2
|
|||
{
|
||||
//private FormHistory formHistory;
|
||||
//System.Windows.Forms.CheckBox
|
||||
|
||||
private bool unSave;
|
||||
private bool FocusContext;
|
||||
private object selectItem;
|
||||
public delegate void saveSetting();
|
||||
|
|
@ -473,8 +473,20 @@ namespace Reseter2
|
|||
{
|
||||
if (tabControl1.SelectedIndex == 3)
|
||||
{
|
||||
unSave = true;
|
||||
UpdateSetting();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(unSave && (settingRebootControl1.edited() ||
|
||||
settingSCCMControl1.edited() ||
|
||||
settingWordsControl1.edited()))
|
||||
{
|
||||
MessageBox.Show("Изменения не сохраненны. Продолжить?");
|
||||
}
|
||||
unSave = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ namespace Reseter2.Setting
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void Save()
|
||||
{
|
||||
SGlobalSetting.settingReboot.checkConnect = (int)nb_checkConnect.Value;
|
||||
|
|
@ -39,6 +40,15 @@ namespace Reseter2.Setting
|
|||
|
||||
}
|
||||
|
||||
|
||||
public bool edited()
|
||||
{
|
||||
return (SGlobalSetting.settingReboot.checkConnect != (int)nb_checkConnect.Value ||
|
||||
SGlobalSetting.settingReboot.timeOutReboot != (int)nb_timeOutReboot.Value ||
|
||||
SGlobalSetting.settingReboot.timeCheckBeforReboot != (int)nb_timeCheckBeforReboot.Value ||
|
||||
SGlobalSetting.settingReboot.sizeHistoryItem != (int)nb_sizeHistoryItem.Value);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,18 @@ namespace Reseter2.Setting
|
|||
{
|
||||
AuthControl(!cb_windowsAuth.Checked);
|
||||
}
|
||||
|
||||
public bool edited()
|
||||
{
|
||||
return (SGlobalSetting.settingSCCM.server != ib_server.Text ||
|
||||
SGlobalSetting.settingSCCM.dataBase != ib_dataBase.Text ||
|
||||
SGlobalSetting.settingSCCM.username != ib_username.Text ||
|
||||
SGlobalSetting.settingSCCM.password != ib_password.Text ||
|
||||
SGlobalSetting.settingSCCM.on != cb_on.Checked ||
|
||||
SGlobalSetting.settingSCCM.windowsAuth != cb_windowsAuth.Checked);
|
||||
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
SGlobalSetting.settingSCCM.server = ib_server.Text;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,12 @@ namespace Reseter2.Setting
|
|||
}
|
||||
}
|
||||
|
||||
public bool edited()
|
||||
{
|
||||
return (SGlobalSetting.settingWords.PathBase != path.Text);
|
||||
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
if(SGlobalSetting.settingWords.PathBase != path.Text)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ namespace Reseter2.Words
|
|||
return treeNodes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static TreeNode[] ListNodes(WordsCategory ChangeCategory)
|
||||
{
|
||||
TreeNode[] treeNodes = new TreeNode[ChangeCategory.Count()];
|
||||
|
|
|
|||
Loading…
Reference in New Issue