Exemple #1
0
        public object LoadAssembly(string file)
        {
            DotNetProject project = null;

            foreach (DotNetProject p in solution.GetAllSolutionItems <DotNetProject> ())
            {
                foreach (var conf in p.Configurations)
                {
                    if (p.GetOutputFileName(conf.Selector) == file)
                    {
                        project = p;
                        break;
                    }
                }
            }
            if (project != null)
            {
                return(ProjectDomService.GetProjectDom(project));
            }
            else
            {
                if (!loadedDoms.Contains(file))
                {
                    loadedDoms.Add(file);
                    ProjectDomService.LoadAssembly(Runtime.SystemAssemblyService.DefaultRuntime, file);
                }
                return(ProjectDomService.GetAssemblyDom(Runtime.SystemAssemblyService.DefaultRuntime, file));
            }
        }
        void LoadExceptions()
        {
            ProjectDom dom;

            if (IdeApp.ProjectOperations.CurrentSelectedProject != null)
            {
                dom = ProjectDomService.GetProjectDom(IdeApp.ProjectOperations.CurrentSelectedProject);
            }
            else
            {
                string asm = typeof(Uri).Assembly.Location;
                if (!systemLoaded)
                {
                    ProjectDomService.LoadAssembly(Runtime.SystemAssemblyService.CurrentRuntime, asm);
                    systemLoaded = true;
                }
                dom = ProjectDomService.GetAssemblyDom(Runtime.SystemAssemblyService.CurrentRuntime, asm);
            }
            classes.Add("System.Exception");
            foreach (IType t in dom.GetSubclasses(dom.GetType("System.Exception", true)))
            {
                classes.Add(t.FullName);
            }
        }