Esempio n. 1
0
        /// <summary>
        /// 导入ETS项目文件中的 groupaddress
        /// </summary>
        private void ImportEtsProject()
        {
            try
            {
                using (var ofd = new OpenFileDialog())
                {
                    ofd.Filter           = EtsFilter;
                    ofd.FilterIndex      = 1;
                    ofd.DefaultExt       = "knxproj";
                    ofd.RestoreDirectory = true;

                    if (ofd.ShowDialog(this) == DialogResult.OK)
                    {
                        ClearProjTempFolder();

                        if (Directory.Exists(MyCache.ProjTempFolder))
                        {
                            this.backWorkerImportEtsProject.RunWorkerAsync(ofd); // 运行 backgroundWorker 组件
                            importInd      = new FrmProgress(this.backWorkerImportEtsProject);
                            importInd.Text = string.Format(UIResMang.GetString("TextIsImporting"), ofd.FileName);
                            importInd.ShowDialog(this);
                            importInd.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string errorMsg = UIResMang.GetString("Message17");
                MessageBox.Show(errorMsg, UIResMang.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log.Error(errorMsg + LogHelper.Format(ex));
            }
        }
Esempio n. 2
0
        private void buttonFinish_Click(object sender, EventArgs e)
        {
            this.dataGridView.EndEdit();

            this.backWorkerSave.RunWorkerAsync();
            importInd      = new FrmProgress(this.backWorkerSave);
            importInd.Text = UIResMang.GetString("Importing");
            importInd.ShowDialog(this);
            importInd.Close();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Esempio n. 3
0
        private void ImportOPC()
        {
            using (var ofd = new OpenFileDialog())
            {
                ofd.Filter           = OpcFilter;
                ofd.FilterIndex      = 1;
                ofd.DefaultExt       = "esf";
                ofd.RestoreDirectory = true;

                if (ofd.ShowDialog(this) == DialogResult.OK)
                {
                    this.backgroundWorkerImportOPC.RunWorkerAsync(ofd);
                    importInd      = new FrmProgress(this.backgroundWorkerImportOPC);
                    importInd.Text = string.Format(UIResMang.GetString("TextIsImporting"), ofd.FileName);
                    importInd.ShowDialog(this);
                    importInd.Close();
                }
            }
        }
Esempio n. 4
0
        private void buttonFinish_Click(object sender, EventArgs e)
        {
            this.dataGridView.EndEdit();

            this.backWorkerSave.RunWorkerAsync();
            importInd = new FrmProgress(this.backWorkerSave);
            importInd.Text = ResourceMng.GetString("Importing");
            importInd.ShowDialog(this);
            importInd.Close();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Esempio n. 5
0
        /// <summary>
        /// 导入ETS项目文件中的 groupaddress
        /// </summary>
        private void ImportEtsProject()
        {
            try
            {
                using (var ofd = new OpenFileDialog())
                {
                    ofd.Filter = EtsFilter;
                    ofd.FilterIndex = 1;
                    ofd.DefaultExt = "knxproj";
                    ofd.RestoreDirectory = true;

                    if (ofd.ShowDialog(this) == DialogResult.OK)
                    {
                        ClearProjTempFolder();

                        if (Directory.Exists(MyCache.ProjTempFolder))
                        {
                            this.backWorkerImport.RunWorkerAsync(ofd); // 运行 backgroundWorker 组件
                            importInd = new FrmProgress(this.backWorkerImport);
                            importInd.Text = string.Format(ResourceMng.GetString("TextIsImporting"), ofd.FileName);
                            importInd.ShowDialog(this);
                            importInd.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string errorMsg = ResourceMng.GetString("Message17");
                MessageBox.Show(errorMsg, ResourceMng.GetString("Message6"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log.Error(errorMsg + LogHelper.Format(ex));
            }
        }