public static void RegisterSourceTreeResolver() { SourceTreeResolverOptions lOptions = new SourceTreeResolverOptions(); lOptions.SearchInAssemblies = true; lOptions.CacheElementsFromAssemblies = true; ParserServices.RegisterSourceTreeResolver(new SourceTreeResolver(lOptions, ParserServices.LanguageService)); }
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(); }
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(); }
// private methods... static void RegisterXmlDocParser() { ParserServices.RegisterXmlDocParser(new NewXmlParser()); }