コード例 #1
0
        private static IEnumerable <ClassDeclarationSyntax> GetConfigurationClasses(SyntaxNode syntaxNode, SemanticModel model)
        {
            var configurationClasses = new List <ClassDeclarationSyntax>();

            var classNode = AllocationRules.GetConfigurationClass(syntaxNode, model);

            if (classNode != null)
            {
                configurationClasses.Add(classNode);
            }

            foreach (var child in syntaxNode.ChildNodes())
            {
                configurationClasses.AddRange(GetConfigurationClasses(child, model));
            }

            return(configurationClasses);
        }
        /// <summary>
        /// Initialization of the package; this method is called right after
        /// the package is sited.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            SettingsManager       settingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider);
            WritableSettingsStore settingsStore   = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

            AllocationRules.Settings = new HeapAllocationAnalyzerSettings(new SettingsStoreWrapper(settingsStore), AllocationRules.DefaultValues());
        }