示例#1
0
        public static void RegisterSourceTreeResolver()
        {
            SourceTreeResolverOptions lOptions = new SourceTreeResolverOptions();

            lOptions.SearchInAssemblies          = true;
            lOptions.CacheElementsFromAssemblies = true;
            ParserServices.RegisterSourceTreeResolver(new SourceTreeResolver(lOptions, ParserServices.LanguageService));
        }
示例#2
0
        public static void UnRegisterParserServices()
        {
            if (ParseWorkerThread.Instance != null)
            {
                ParseWorkerThread.Stop();
            }

            try
            {
                MethodInfo finalizeService = typeof(StringServices).GetMethod("FinalizeService", BindingFlags.NonPublic | BindingFlags.Instance);
                finalizeService.Invoke(ParserServices.StringService, new object[] { FinalizeCause.HostShutdown });
            }
            catch { }
            ParserServices.UnregisterIssueService();
            ParserServices.UnregisterLanguageService();
            ParserServices.UnregisterSourceModelService();
            ParserServices.UnregisterSourceTreeResolver();
        }
示例#3
0
        public static void RegisterParserServices()
        {
            ILanguageService        lLanguage       = (ILanguageService)CreateParserService(typeof(LanguageServices));
            ISourceModelService     lSource         = (ISourceModelService)CreateParserService(typeof(SourceModelServices));
            IssueServices           lIssues         = (IssueServices)CreateParserService(typeof(IssueServices));
            PlugInExtensionServices lPluginServices = (PlugInExtensionServices)CreateParserService(typeof(PlugInExtensionServices));

            ParserServices.RegisterLanguageService(lLanguage);
            ParserServices.RegisterSourceModelService(lSource);
            ParserServices.RegisterIssueService(lIssues);

            CodeRush.SetupServiceManager(new ServiceManager());
            //CodeRush.ChangeState(CodeRushState.Initialized, CodeRushStateCause.User);
            //  CodeRush.PlugInExtensions.
            //  CR_StyleCop.CR_StyleCopPlugIn plugin = new CR_StyleCop.CR_StyleCopPlugIn();
            //  lPluginServices.Register;

            lLanguage.RegisterParsers(ParserHelper.GetParsers());
            RegisterSourceTreeResolver();

            ParseWorkerThread.Start();
        }
示例#4
0
 // private methods...
 static void RegisterXmlDocParser()
 {
     ParserServices.RegisterXmlDocParser(new NewXmlParser());
 }