Exemplo n.º 1
0
        /// <summary>
        /// Loads a Project object from its serialized representation. First loads the programs
        /// and then any extra metadata files.
        /// </summary>
        /// <param name="sp"></param>
        /// <returns></returns>
        public Project LoadProject(string projectFilePath, Project_v2 sp)
        {
            var typelibs = sp.Inputs.OfType <MetadataFile_v2>().Select(m => VisitMetadataFile(m));
            var programs = sp.Inputs.OfType <DecompilerInput_v2>().Select(s => VisitInputFile(projectFilePath, s));
            var asm      = sp.Inputs.OfType <AssemblerFile_v2>().Select(s => VisitAssemblerFile(s));

            project.MetadataFiles.AddRange(typelibs);
            project.Programs.AddRange(programs);
            return(this.project);
        }
Exemplo n.º 2
0
        public Project_v2 Save(Project project)
        {
            var inputs = new List <ProjectFile_v2>();

            inputs.AddRange(project.Programs.Select(prog => VisitProgram(prog)));
            inputs.AddRange(project.MetadataFiles.Select(m => VisitMetadataFile(m)));
            var sp = new Project_v2()
            {
                Inputs = inputs
            };

            return(sp);
        }
Exemplo n.º 3
0
 public Project LoadProject(string projectFilePath, Project_v2 sp)
 {
     var typelibs = sp.Inputs.OfType<MetadataFile_v2>().Select(m => VisitMetadataFile(m));
     var programs = sp.Inputs.OfType<DecompilerInput_v2>().Select(s => VisitInputFile(projectFilePath, s)).ToList();
     var sAsms = sp.Inputs.OfType<AssemblerFile_v2>().ToList();
     programs.AddRange(sAsms.Select(s => VisitAssemblerFile(s)));
     if (this.platform != null)
     {
         this.project.LoadedMetadata = this.platform.CreateMetadata();
     }
     foreach (var program in programs)
     {
         program.EnvironmentMetadata = this.project.LoadedMetadata;
     }
     project.MetadataFiles.AddRange(typelibs);
     project.Programs.AddRange(programs);
     return this.project;
 }
Exemplo n.º 4
0
 public Project VisitProject_v2(Project_v2 sProject) { return outer.LoadProject(filename, sProject); }
Exemplo n.º 5
0
        public void Save(Project_v2 project, TextWriter sw)
        {
            XmlSerializer ser = SerializedLibrary.CreateSerializer_v1(typeof(Project_v2));

            ser.Serialize(sw, project);
        }