Ejemplo n.º 1
0
        public MgaFCO RunDesignExporter(string asmName)
        {
            MgaFCO componentAssembly;

            proj.BeginTransactionInNewTerr();
            string fileExtension = ".adp";

            try
            {
                componentAssembly = (MgaFCO)proj.RootFolder.GetObjectByPathDisp("/@" + FolderName + "/@" + asmName);
                if (componentAssembly.Meta.Name == "DesignContainer")
                {
                    fileExtension = ".adm";
                }
                Assert.NotNull(componentAssembly);
                var designExporter = new CyPhyDesignExporter.CyPhyDesignExporterInterpreter();
                designExporter.Initialize(proj);

                var parameters = new CyPhyGUIs.InterpreterMainParameters()
                {
                    CurrentFCO      = componentAssembly,
                    Project         = proj,
                    OutputDirectory = AdmPath
                };

                designExporter.MainInTransaction(parameters, true);
            }
            finally
            {
                proj.AbortTransaction();
            }

            Assert.True(File.Exists(Path.Combine(fixture.AdmPath, asmName + fileExtension)));
            return(componentAssembly);
        }