Ejemplo n.º 1
0
        public virtual void onConfirm()
        {
            string savePath = "";//保存文件夹

            try
            {
                var list = projectUtils.GetAllTowerSequenceNames();
                if (list.Contains(FullName.Trim()))
                {
                    MessageBox.Show("序列名称已经存在,请修改后重新保存!");
                    return;
                }
                savePath = projectUtils.ProjectPath + "\\" + ConstVar.TowerSequenceStr + "\\" + FullName.Trim();

                //读取并计算DA文件
                List <TowerSerial> seriallist = TowerSerialReader.ReadTa(FilePath);
                //保存源文件数据
                TowerSerialReader.CopySourceFile(FullName, FilePath, savePath);

                //保存计算后的杆塔序列文件
                TowerSerialReader.SaveDT(seriallist, savePath);

                projectUtils.InsertTowerSequenceName(FullName);//新增序列节点

                close(FullName);
            }
            catch (Exception ex)
            {
                if (Directory.Exists(savePath))
                {
                    Directory.Delete(savePath, true);
                }
                MessageBox.Show("保存过程中出错,错误信息如下:" + ex.Message);
            }
        }