Пример #1
0
        private void TryAddItem(IProjectItem projectItem)
        {
            IProjectContext projectContext = (IProjectContext)ProjectXamlContext.GetProjectContext(projectItem.Project);

            if (projectContext == null)
            {
                return;
            }
            IProjectDocument document1 = projectContext.GetDocument(DocumentReferenceLocator.GetDocumentLocator(projectItem.DocumentReference));

            if (document1 != null && document1.DocumentType == ProjectDocumentType.ResourceDictionary && this.FindProvider(projectItem) == null)
            {
                IDocument document2 = projectItem.Document;
                this.ProjectResourceAssetAggregator.AddProvider((AssetProvider) new ResourceDictionaryAssetProvider(this.DesignerContext.ResourceManager.GetContentProviderForResourceDictionary(projectItem)));
            }
            this.ProjectAssetProvider.NeedsUpdate = true;
        }