Ejemplo n.º 1
0
        private void CopySubAssemblyFile(SubassemblyViewModel sub, int rowIndex)
        {
            logger.Debug("开始从组件库中拷贝cutx文件");

            string file = string.Format("{0}_({1}){2}.cutx",
                                        productHandle,
                                        sub.Name,
                                        rowIndex + 1);

            file = Path.Combine(project.JobPath, "Subassemblies", file);

            logger.Debug("完整文件路径:" + file);

            try
            {
                //TODO:这里用了覆盖拷贝,是否有风险?
                File.Copy(sub.CutxPath, file, true);
            }
            catch (System.Exception error)
            {
                logger.Error("拷贝文件时发生错误:" + error.Message + Environment.NewLine + error.StackTrace);
                throw error;
            }
        }
        private void CopySubAssemblyFile(SubassemblyViewModel sub, int rowIndex)
        {
            logger.Debug("开始从组件库中拷贝cutx文件");

            string file = string.Format("{0}_({1}){2}.cutx",
                                        productHandle,
                                        sub.Name,
                                        rowIndex + 1);

            file = Path.Combine(project.JobPath, "Subassemblies", file);

            logger.Debug("完整文件路径:" + file);

            try
            {
                //TODO:这里用了覆盖拷贝,是否有风险?
                File.Copy(sub.CutxPath, file, true);
            }
            catch (System.Exception error)
            {
                logger.Error("拷贝文件时发生错误:" + error.Message + Environment.NewLine + error.StackTrace);
                throw error;
            }
        }