Esempio n. 1
0
        /// <summary>
        /// Prompts the user for a metadata file and adds to the project.
        /// </summary>
        public void AddMetadataFile()
        {
            var fileName = uiSvc.ShowOpenFileDialog(null);

            if (fileName == null)
            {
                return;
            }
            var projectLoader = new ProjectLoader(
                Services,
                loader,
                this.decompilerSvc.Decompiler.Project,
                this.sc.RequireService <DecompilerEventListener>());

            try
            {
                var metadata = projectLoader.LoadMetadataFile(fileName);
                decompilerSvc.Decompiler.Project.MetadataFiles.Add(metadata);
                RememberFilenameInMru(fileName);
            }
            catch (Exception e)
            {
                uiSvc.ShowError(e, "An error occured while parsing the metadata file {0}", fileName);
            }
        }
Esempio n. 2
0
        private void BrowseAssemblyFile_Click(object sender, EventArgs e)
        {
            var newFile = uiSvc.ShowOpenFileDialog(dlg.AssemblyFile.Text);

            if (newFile != null)
            {
                dlg.AssemblyFile.Text = newFile;
            }
        }
Esempio n. 3
0
        public void AddMetadataFile()
        {
            var fileName = uiSvc.ShowOpenFileDialog(null);

            if (fileName == null)
            {
                return;
            }
            mru.Use(fileName);
            var projectLoader = new ProjectLoader(Services, loader, this.decompilerSvc.Decompiler.Project);
            var metadata      = projectLoader.LoadMetadataFile(fileName);

            decompilerSvc.Decompiler.Project.MetadataFiles.Add(metadata);
        }
Esempio n. 4
0
        public void AddMetadataFile()
        {
            var fileName = uiSvc.ShowOpenFileDialog(null);

            if (fileName == null)
            {
                return;
            }
            mru.Use(fileName);
            var typelib = decompilerSvc.Decompiler.LoadMetadata(fileName);

            decompilerSvc.Decompiler.Project.MetadataFiles.Add(new MetadataFile {
                Filename    = fileName,
                ModuleName  = Path.GetFileName(fileName),
                TypeLibrary = typelib
            });
        }