private void OnProjectContextDocumentClosedLate(object sender, ProjectDocumentEventArgs e)
        {
            List <SceneView> list1 = (List <SceneView>)null;

            if (this.pendingViewsForClosedDocuments.TryGetValue(e.Document, out list1))
            {
                this.pendingViewsForClosedDocuments.Remove(e.Document);
                List <SceneView> list2 = (List <SceneView>)null;
                foreach (SceneView sceneView in list1)
                {
                    if (ViewUpdateManager.GetDocumentRelation(sceneView, e.Document) == ViewUpdateManager.DocumentRelation.Related)
                    {
                        if (list2 == null)
                        {
                            list2 = new List <SceneView>();
                        }
                        list2.Add(sceneView);
                    }
                }
                if (list2 != null)
                {
                    this.InvalidateViewsInternal((ICollection <SceneView>)list2);
                }
            }
            SceneView activeView = this.DesignerContext.ActiveView;

            if (activeView == null)
            {
                return;
            }
            activeView.RebuildUserControls(e.Document);
        }
        public void EnsureViewUpdatesForRelatedDocument(SceneView sceneView, SceneDocument sceneDocument)
        {
            ViewUpdateManager.RelatedDocumentTable relatedDocumentTable;
            if (!this.relatedDocumentsForView.TryGetValue(sceneView, out relatedDocumentTable))
            {
                relatedDocumentTable = new ViewUpdateManager.RelatedDocumentTable();
                this.relatedDocumentsForView[sceneView] = relatedDocumentTable;
            }
            if (sceneDocument == sceneView.Document || relatedDocumentTable.Contains(sceneDocument))
            {
                return;
            }
            IProjectDocument document = sceneDocument.ProjectContext.GetDocument(sceneDocument.DocumentRoot);

            if (ViewUpdateManager.GetDocumentRelation(sceneView, document) != ViewUpdateManager.DocumentRelation.Related || ViewUpdateManager.IsDisposingOrDisposed(sceneDocument.ProjectContext))
            {
                return;
            }
            relatedDocumentTable.Add(sceneDocument);
            this.RegisterRelatedDocumentInternal(sceneView, sceneDocument);
        }