Example #1
0
        private void FrmModuleConfig_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName,
                                     new FormTranslatorOptions {
                ContextMenus = new ContextMenuStrip[] { cmsTree }
            });

            if (!string.IsNullOrEmpty(configProvider.FormTitle))
            {
                Text = configProvider.FormTitle;
            }

            propertyGrid.ToolbarVisible = configProvider.GridToolbarVisible;
            propertyGrid.HelpVisible    = configProvider.GridHelpVisible;
            propertyGrid.PropertySort   = configProvider.GridSort;

            if (!configProvider.LoadConfig(out string errMsg))
            {
                ScadaUiUtils.ShowError(errMsg);
            }

            configProvider.BackupConfig();
            Modified = false;

            AddToolButtons();
            TakeTreeViewImages();
            FillTreeView();
        }
 private void FrmCommTcpServerProps_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName, new FormTranslatorOptions {
         ToolTip = toolTip
     });
     OptionsToControls();
 }
Example #3
0
 private void FrmLineAdd_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName);
     FillInstanceList();
     SetLineNum();
     txtName.Select();
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 public FrmFind(FrmBaseTable frmBaseTable, DataGridView dataGridView)
     : this()
 {
     this.frmBaseTable = frmBaseTable ?? throw new ArgumentNullException(nameof(frmBaseTable));
     this.dataGridView = dataGridView ?? throw new ArgumentNullException(nameof(dataGridView));
     FormTranslator.Translate(this, GetType().FullName);
 }
Example #5
0
 private void FrmTableExport_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName);
     saveFileDialog.SetFilter(ExtensionPhrases.ExportTableFilter);
     ExtensionUtils.FillTableList(cbTable, configDatabase, SelectedItemType);
     cbFormat.SelectedIndex = 0;
 }
Example #6
0
 private async void FrmRegistration_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName);
     LoadRegKey();
     txtRegKey.Select();
     await Task.Run(() => RequestCompCode());
 }
Example #7
0
 private void toolStripMenuItem_addimg_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(main.PicFileName))
     {
         var f = FormTranslator.Translate(new Form_Dialog_MacroAddImage());
         if (f.ShowDialog() == DialogResult.OK)
         {
             main.PicFileName = f.Path;
             main.PicSize     = new SizeF(f.XSize, f.YSize);
             MacroBmp         = new Bitmap(f.Path);
         }
         ;
     }
     else
     {
         var f = FormTranslator.Translate(new Form_Dialog_MacroAddImage()
         {
             Path  = main.PicFileName,
             XSize = main.PicSize.Width,
             YSize = main.PicSize.Height
         });
         if (f.ShowDialog() == DialogResult.OK)
         {
             main.PicFileName = f.Path;
             main.PicSize     = new SizeF(f.XSize, f.YSize);
             MacroBmp         = new Bitmap(f.Path);
         }
         ;
     }
 }
Example #8
0
 private void FrmPasswordSet_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName);
     txtUserID.Text = UserID.ToString();
     txtPassword.Select();
     btnHidePassword.Top = btnShowPassword.Top;
     SetOkEnabled();
 }
Example #9
0
 private void FrmStartPage_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName,
                              new FormTranslatorOptions {
         ContextMenus = new ContextMenuStrip[] { cmsProjectList }
     });
     FillRecentProjectList();
 }
Example #10
0
        private void FrmInCnl_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            FormTranslator.Translate(bmArchive, bmArchive.GetType().FullName);
            FormTranslator.Translate(bmEvent, bmEvent.GetType().FullName);

            ShowItemProps();
        }
Example #11
0
 private void FrmProfileEdit_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName);
     FormTranslator.Translate(ctrlAgentConnection, ctrlAgentConnection.GetType().FullName);
     FormTranslator.Translate(ctrlDbConnection, ctrlDbConnection.GetType().FullName);
     FillExtensionComboBox();
     ConfigToControls();
 }
Example #12
0
 private void FrmDataSources_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName);
     FillDriverComboBox();
     SetControlsEnabled();
     ConfigToControls();
     btnPaste.Enabled = false;
 }
Example #13
0
        private void FrmFileAssociation_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            openFileDialog.SetFilter(AppPhrases.ExecutableFileFilter);

            txtExt.Text  = FileExtension;
            txtPath.Text = ExecutablePath;
        }
Example #14
0
        private void FrmBitMask_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            FormTranslator.Translate(ctrlBitMask, ctrlBitMask.GetType().FullName);

            ctrlBitMask.ShowMask();
            ctrlBitMask.SetFocus();
        }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 public FrmFilter(DataGridView dataGridView, DataTable dataTable)
     : this()
 {
     this.dataGridView = dataGridView ?? throw new ArgumentNullException(nameof(dataGridView));
     this.dataTable    = dataTable ?? throw new ArgumentNullException(nameof(dataTable));
     currentFilter     = null;
     FormTranslator.Translate(this, GetType().FullName);
 }
Example #16
0
 private void CtrlLineReqSequence_Load(object sender, EventArgs e)
 {
     FormTranslator.Translate(this, GetType().FullName,
                              new FormTranslatorOptions {
         ToolTip = toolTip, SkipUserControls = false
     });
     SetControlsEnabled();
     btnPasteDevice.Enabled = false;
 }
Example #17
0
        private void FrmConnManager_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            FormTranslator.Translate(ctrlClientConnection, ctrlClientConnection.GetType().FullName);
            ActiveControl = lvConn;

            LoadConfig();
            FillConnList();
        }
Example #18
0
        private void FrmLimCreate_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);

            if (CnlNum > 0)
            {
                txtName.Text = string.Format(AppPhrases.DefaultLimName, CnlNum);
            }
        }
Example #19
0
        private void FrmLineOptions_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            Text = string.Format(ExtensionPhrases.LineConfigTitle, lineConfig.CommLineNum);

            ChildFormTag.MessageToChildForm += ChildFormTag_MessageToChildForm;
            ctrlLineMain.Init(adminContext, commApp);
            ctrlLinePolling.Init(adminContext, commApp, lineConfig);
            lbTabs.SelectedIndex = 0;
        }
Example #20
0
        private void FrmEditSource_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            txtPlainText.MaxLength = MaxLength;
            string text = Normalize(PlainText);

            txtPlainText.Text = text.Length <= MaxLength ? text : text.Substring(0, MaxLength);
            ShowCurrentLine();
            ShowTextLength();
        }
Example #21
0
        private void FrmOpcUaServerDSO_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName, new FormTranslatorOptions {
                ToolTip = toolTip
            });
            openFileDialog.SetFilter(CommonPhrases.XmlFileFilter);
            saveFileDialog.SetFilter(CommonPhrases.XmlFileFilter);

            OptionsToControls();
        }
Example #22
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (listBox_Main.SelectedIndex != -1)
     {
         FormTranslator.Translate(new Form_Dialog_EditGraph(Main.Graphs[listBox_Main.SelectedIndex])).ShowDialog();
         Main.ResetPrerender();
         UpdateListBox();
         RedrawHigh(pictureBox1.Width / 2 - dx, pictureBox1.Height / 2 - dy);
     }
 }
Example #23
0
        private void FrmDeviceData_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            Text = string.Format(Text, deviceConfig.DeviceNum);

            ChildFormTag.MessageToChildForm += ChildFormTag_MessageToChildForm;

            InitLogBox();
            tmrRefresh.Interval = ScadaUiUtils.LogRemoteRefreshInterval;
            tmrRefresh.Start();
        }
Example #24
0
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public FrmDeviceCommand(IAdminContext adminContext, DeviceConfig deviceConfig)
            : this()
        {
            this.adminContext = adminContext ?? throw new ArgumentNullException(nameof(adminContext));
            this.deviceConfig = deviceConfig ?? throw new ArgumentNullException(nameof(deviceConfig));
            AgentClient       = null;

            FormTranslator.Translate(this, GetType().FullName);
            Text             = string.Format(Text, CommUtils.GetDeviceTitle(deviceConfig));
            rbNumVal.Checked = true;
        }
Example #25
0
        private void FrmLineStats_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            Text = string.Format(ExtensionPhrases.LineStatsTitle, lineConfig.CommLineNum);

            ChildFormTag.MessageToChildForm += ChildFormTag_MessageToChildForm;
            lbTabs.SelectedIndex             = 0;

            InitLogBoxes();
            tmrRefresh.Interval = ScadaUiUtils.LogRemoteRefreshInterval;
            tmrRefresh.Start();
        }
Example #26
0
        private void FrmCnlCreate_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            FormTranslator.Translate(ctrlCnlCreate1, ctrlCnlCreate1.GetType().FullName);
            FormTranslator.Translate(ctrlCnlCreate2, ctrlCnlCreate2.GetType().FullName);
            FormTranslator.Translate(ctrlCnlCreate3, ctrlCnlCreate3.GetType().FullName);

            ctrlCnlCreate1.Init(adminContext, project, recentSelection);
            ctrlCnlCreate2.Init(project, recentSelection);
            ctrlCnlCreate3.Init(adminContext, project);
            ApplyStep(0);
        }
Example #27
0
        private void FrmInstanceProfile_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName);
            FormTranslator.Translate(ctrlProfileSelector, ctrlProfileSelector.GetType().FullName);

            ctrlProfileSelector.Init(appData, project.DeploymentConfig, instance);

            if (ctrlProfileSelector.SelectedProfile != null)
            {
                initialProfile = ctrlProfileSelector.SelectedProfile.DeepClone();
            }
        }
Example #28
0
        private void FrmTableEditor_Load(object sender, EventArgs e)
        {
            FormTranslator.Translate(this, GetType().FullName,
                                     new FormTranslatorOptions {
                ContextMenus = new ContextMenuStrip[] { cmsDevice }
            });
            ChildFormTag.MessageToChildForm += ChildFormTag_MessageToChildForm;
            Text = Path.GetFileName(fileName);

            TakeTreeViewImages();
            FillTreeView();
            LoadTableView();
        }
Example #29
0
 private void button_openineditor_Click(object sender, EventArgs e)
 {
     if (listBox_macroses.SelectedIndex != -1)
     {
         FormTranslator.Translate(new Form_Macro(main.Elems[listBox_macroses.SelectedIndex].Path)).Show();
     }
     else
     {
         MessageBox.Show(
             TB.L.Phrase["Form_MacroPack.SelectMacro"],
             TB.L.Phrase["Form_MacroPack.Error"],
             MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #30
0
        private void FrmConfig_Load(object sender, EventArgs e)
        {
            // translate form
            FormTranslator.Translate(this, GetType().FullName);
            Text = string.Format(Text, deviceNum);

            // load configuration
            if (File.Exists(configFileName) && !config.Load(configFileName, out string errMsg))
            {
                ScadaUiUtils.ShowError(errMsg);
            }

            // display configuration
            ConfigToControls();
        }