SCCManager/Remontor/FlowConteinerSetting.cs

92 lines
2.7 KiB
C#

using Remontor.Setting;
using Remontor.Words;
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;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Remontor
{
internal partial class FlowConteinerSetting : UserControl
{
public delegate void DUpdateTree();
public DUpdateTree UpdateTree;
public delegate void saveSetting();
public event saveSetting Save;
private bool unSave = false;
public FlowConteinerSetting()
{
InitializeComponent();
Save += settingAppControl1.Save;
Save += settingSCCMControl1.Save;
Save += settingWordsControl1.Save;
}
public bool HideBar(BarShow barShow)
{
if (barShow == BarShow.ShowSetting)
{
this.Visible = true;
settingAppControl1.UpdateSetting();
settingSCCMControl1.UpdateSetting();
settingWordsControl1.UpdateSetting();
}
else
{
this.Visible = false;
}
return this.Visible;
}
//private bool NotSave()
//{
// if (tabControl1.SelectedIndex == 3)
// {
// if (!unSave)
// {
// unSave = true;
// UpdateSetting();
// }
// }
// else
// {
// if (unSave && (settingAppControl1.edited() ||
// settingSCCMControl1.edited() ||
// settingWordsControl1.edited()))
// {
// DialogResult result = MessageBox.Show("Изменения не сохраненны. Продолжить?", "Изменения не сохраненны.", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
// switch (result)
// {
// case DialogResult.Cancel:
// tabControl1.SelectedIndex = 3;
// break;
// case DialogResult.OK:
// unSave = false;
// break;
// }
// }
// }
//}
private void BtSave_Click(object sender, EventArgs e)
{
Save();
SGlobalSetting.SaveSettig();
SGlobalSetting.LoadSetting();
WordsList.MainCategory = SGlobalSetting.LoadWords();
UpdateTree();
}
}
}