Exemple #1
0
 /// <summary>
 /// Установить элементы управления в соответствии с параметрами приложения
 /// </summary>
 public void ParamsToControls(Settings.AppSettings appSettings)
 {
     txtBaseSDFFile.Text = appSettings.BaseSDFFile;
     txtBaseDATDir.Text = appSettings.BaseDATDir;
     txtBackupDir.Text = appSettings.BackupDir;
     txtKPDir.Text = appSettings.KPDir;
 }
Exemple #2
0
 /// <summary>
 /// Установить параметры приложения в соответствии с элементами управления
 /// </summary>
 public void ControlsToParams(Settings.AppSettings appSettings)
 {
     appSettings.BaseSDFFile = txtBaseSDFFile.Text;
     appSettings.BaseDATDir = txtBaseDATDir.Text;
     appSettings.BackupDir = txtBackupDir.Text;
     appSettings.KPDir = txtKPDir.Text;
 }
Exemple #3
0
 /// <summary>
 /// Установить элементы управления в соответствии с параметрами приложения
 /// </summary>
 public void ParamsToControls(Settings.AppSettings appSettings)
 {
     txtBaseSDFFile.Text = appSettings.BaseSDFFile;
     txtBaseDATDir.Text = appSettings.BaseDATDir;
     txtBackupDir.Text = appSettings.BackupDir;
     txtCommDir.Text = appSettings.CommDir;
     chkAutoBackupBase.Checked = appSettings.AutoBackupBase;
 }
Exemple #4
0
 /// <summary>
 /// Установить параметры приложения в соответствии с элементами управления
 /// </summary>
 public void ControlsToParams(Settings.AppSettings appSettings)
 {
     appSettings.BaseSDFFile = txtBaseSDFFile.Text;
     appSettings.BaseDATDir = txtBaseDATDir.Text;
     appSettings.BackupDir = txtBackupDir.Text;
     appSettings.CommDir = txtCommDir.Text;
     appSettings.AutoBackupBase = chkAutoBackupBase.Checked;
 }
Exemple #5
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            // локализация приложения
            if (!Localization.UseRussian)
            {
                string langDir = AppData.ExeDir + "Lang\\";
                string errMsg;

                if (Localization.LoadDictionaries(langDir, "ScadaData", out errMsg))
                    CommonPhrases.Init();
                else
                    ScadaUtils.ShowError(errMsg);

                if (Localization.LoadDictionaries(langDir, "ScadaAdmin", out errMsg))
                {
                    Localization.TranslateForm(this, "ScadaAdmin.FrmMain", null, contextExpolorer, contextInCnls);
                    AppPhrases.Init();
                    winControl.MessageText = AppPhrases.SelectTable;
                    winControl.SaveReqCaption = AppPhrases.SaveReqCaption;
                    winControl.SaveReqQuestion = AppPhrases.SaveReqQuestion;
                    winControl.SaveReqYes = AppPhrases.SaveReqYes;
                    winControl.SaveReqNo = AppPhrases.SaveReqNo;
                    winControl.SaveReqCancel = AppPhrases.SaveReqCancel;
                }
                else
                {
                    ScadaUtils.ShowError(errMsg);
                }
            }

            // инициализация дерева проводника
            InitTreeView();

            // установка начального состояния разрешений элементов
            SetItemsEnabledOnConnect();
            SetItemsEnabledOnWindowAction();

            // загрузка состояния формы
            settings = new Settings();
            settings.LoadFormState();
            if (settings.FormSt.IsEmpty)
            {
                WindowState = FormWindowState.Maximized;
            }
            else
            {
                Left = settings.FormSt.Left;
                Top = settings.FormSt.Top;
                Width = settings.FormSt.Width;
                Height = settings.FormSt.Height;
                WindowState = settings.FormSt.Maximized ? FormWindowState.Maximized : FormWindowState.Normal;
                pnlLeft.Width = settings.FormSt.ExplorerWidth;
            }
        }