예제 #1
0
        /// <summary>
        /// Sets the contents of the package from the given experiment, types and components.
        /// </summary>
        /// <param name="pInfo">Experiment info.</param>
        /// <param name="pTypes">Collection of type assembly files.</param>
        /// <param name="pComponents">Collection of component assembly files.</param>
        /// <returns></returns>
        public void GeneratePackageContent()
        {
            //firstly pack experiment
            ExperimentPackagingHelper ePkgHelper = new ExperimentPackagingHelper(this.ExperimentPackageConfig, m_supportedTypes);

            ExperimentPackagingResults pResults = ePkgHelper.PackExperiment(m_experiment);
            
            var info = new PackageSourceInfo();

            // Adding components
            if (pResults.ComponentAssemblies.Count > 0)
            {
                PackageHeirarchyItem componentsFolder = CreateFolder(info.Root, "Components");
                componentsFolder.HasComponents = true;
                foreach (string component in pResults.ComponentAssemblies)
                {
                    AddFile(componentsFolder, component);
                }
            }

            // Adding experiment
            PackageHeirarchyItem experimentFolder = CreateFolder(info.Root, "Experiment");
            AddFile(experimentFolder, pResults.Experiment.ExperimentInfo.FilePath);

            // HERZUM SPRINT 4.2: TLAB-215
            // info.Name = pResults.Experiment.ExperimentInfo.Name + " Package";
            info.Name = pResults.Experiment.ExperimentInfo.Name + "_package";
            // END HERZUM SPRINT 4.2: TLAB-215

            // Adding refered types into subfolder of Experiment
            if (pResults.Files.Count > 0)
            {
                foreach (PackageFileInfo file in pResults.Files)
                {
                    PackageHeirarchyItem lastFolder = CreateRelativeFolders(experimentFolder, file);
                    AddFile(lastFolder, file.AbsoluteLocation);
                }
            }

            //Adding refered directories into subfolder of Experiment
            if (pResults.Directories.Count > 0)
            {
                foreach (PackageFileInfo dir in pResults.Directories)
                {
                    PackageHeirarchyItem lastFolder = CreateRelativeFolders(experimentFolder, dir);
                    AddFolder(lastFolder, dir.AbsoluteLocation);
                }
            }

            // Adding types
            if (pResults.TypeAssemblies.Count > 0)
            {
                PackageHeirarchyItem typesFolder = CreateFolder(info.Root, "Types");
                typesFolder.HasTypes = true;
                foreach (string type in pResults.TypeAssemblies)
                {
                    AddFile(typesFolder, type);
                }
            }

            this.PackageSourceInfo = info;
        }
예제 #2
0
        /// <summary>
        /// Sets the contents of the package from the given experiment, types and components.
        /// </summary>
        /// <param name="pInfo">Experiment info.</param>
        /// <param name="pTypes">Collection of type assembly files.</param>
        /// <param name="pComponents">Collection of component assembly files.</param>
        /// <returns></returns>
        public void GeneratePackageContent()
        {
            //firstly pack experiment
            ExperimentPackagingHelper ePkgHelper = new ExperimentPackagingHelper(this.ExperimentPackageConfig, m_supportedTypes);

            ExperimentPackagingResults pResults = ePkgHelper.PackExperiment(m_experiment);

            var info = new PackageSourceInfo();

            // Adding components
            if (pResults.ComponentAssemblies.Count > 0)
            {
                PackageHeirarchyItem componentsFolder = CreateFolder(info.Root, "Components");
                componentsFolder.HasComponents = true;
                foreach (string component in pResults.ComponentAssemblies)
                {
                    AddFile(componentsFolder, component);
                }
            }

            // Adding experiment
            PackageHeirarchyItem experimentFolder = CreateFolder(info.Root, "Experiment");

            AddFile(experimentFolder, pResults.Experiment.ExperimentInfo.FilePath);

            // HERZUM SPRINT 4.2: TLAB-215
            // info.Name = pResults.Experiment.ExperimentInfo.Name + " Package";
            info.Name = pResults.Experiment.ExperimentInfo.Name + "_package";
            // END HERZUM SPRINT 4.2: TLAB-215

            // Adding refered types into subfolder of Experiment
            if (pResults.Files.Count > 0)
            {
                foreach (PackageFileInfo file in pResults.Files)
                {
                    PackageHeirarchyItem lastFolder = CreateRelativeFolders(experimentFolder, file);
                    AddFile(lastFolder, file.AbsoluteLocation);
                }
            }

            //Adding refered directories into subfolder of Experiment
            if (pResults.Directories.Count > 0)
            {
                foreach (PackageFileInfo dir in pResults.Directories)
                {
                    PackageHeirarchyItem lastFolder = CreateRelativeFolders(experimentFolder, dir);
                    AddFolder(lastFolder, dir.AbsoluteLocation);
                }
            }

            // Adding types
            if (pResults.TypeAssemblies.Count > 0)
            {
                PackageHeirarchyItem typesFolder = CreateFolder(info.Root, "Types");
                typesFolder.HasTypes = true;
                foreach (string type in pResults.TypeAssemblies)
                {
                    AddFile(typesFolder, type);
                }
            }

            this.PackageSourceInfo = info;
        }
예제 #3
0
 public PackageBuilderViewModel() 
 {
     m_packageSourceInfo = new PackageSourceInfo();
     CurrentState = PackageBuilderWizardPage.FileViewer;
 }
예제 #4
0
 public PackageBuilderViewModel()
 {
     m_packageSourceInfo = new PackageSourceInfo();
     CurrentState        = PackageBuilderWizardPage.FileViewer;
 }