Exemplo n.º 1
0
 protected void OnDocumentOpened(IProjectDocument document)
 {
     if (this.DocumentOpened != null)
     {
         this.DocumentOpened(this, new ProjectDocumentEventArgs(document));
     }
 }
Exemplo n.º 2
0
 protected void OnDocumentClosing(IProjectDocument document)
 {
     if (this.DocumentClosing != null)
     {
         this.DocumentClosing(this, new ProjectDocumentEventArgs(document));
     }
 }
Exemplo n.º 3
0
        public XmlPresenter(IProjectDocument doc, IXmlView view)
        {
            this.doc = doc;
            this.view = view;

            view.Xml.Validated += delegate
            {
                UpdateModelFromView();

                if (!doc.IsValid)
                {
                    XmlException ex = doc.Exception as XmlException;
                    if (ex != null)
                        view.DisplayError(ex.Message, ex.LineNumber, ex.LinePosition);
                    else
                        view.DisplayError(doc.Exception.Message);
                }
            };

            doc.ProjectCreated += delegate
            {
                view.Visible = true;
                LoadViewFromModel();
            };

            doc.ProjectClosed += delegate
            {
                view.Xml.Text = null;
                view.Visible = false;
            };
        }
Exemplo n.º 4
0
        internal static IEnumerable <SceneDocument> GetDesignTimeResourceDocuments(IProjectContext projectContext)
        {
            if (projectContext == null || projectContext.Documents == null)
            {
                return(Enumerable.Empty <SceneDocument>());
            }
            List <SceneDocument> list            = new List <SceneDocument>();
            IProjectContext      projectContext1 = projectContext;
            IProjectDocument     application     = projectContext.Application;

            if (application != null)
            {
                SceneDocument sceneDocument = application.Document as SceneDocument;
                if (sceneDocument != null)
                {
                    list.Add(sceneDocument);
                    projectContext1 = sceneDocument.ProjectContext;
                }
            }
            foreach (IProjectDocument projectDocument in (IEnumerable <IProjectDocument>)projectContext1.Documents)
            {
                if (projectDocument.ProjectItem != null && projectDocument.ProjectItem.ContainsDesignTimeResources)
                {
                    SceneDocument sceneDocument = projectDocument.Document as SceneDocument;
                    if (sceneDocument != null)
                    {
                        list.Add(sceneDocument);
                    }
                }
            }
            return((IEnumerable <SceneDocument>)list);
        }
Exemplo n.º 5
0
        public XmlPresenter(IProjectDocument doc, IXmlView view)
        {
            this.doc  = doc;
            this.view = view;

            view.Xml.Validated += delegate
            {
                UpdateModelFromView();

                if (!doc.IsValid)
                {
                    XmlException ex = doc.Exception as XmlException;
                    if (ex != null)
                    {
                        view.DisplayError(ex.Message, ex.LineNumber, ex.LinePosition);
                    }
                    else
                    {
                        view.DisplayError(doc.Exception.Message);
                    }
                }
            };

            doc.ProjectCreated += delegate
            {
                view.Visible = true;
                LoadViewFromModel();
            };

            doc.ProjectClosed += delegate
            {
                view.Xml.Text = null;
                view.Visible  = false;
            };
        }
Exemplo n.º 6
0
 protected void OnDocumentClosed(IProjectDocument document)
 {
     if (this.DocumentClosed == null)
     {
         return;
     }
     this.DocumentClosed((object)this, new ProjectDocumentEventArgs(document));
 }
Exemplo n.º 7
0
 public void Initialize()
 {
     doc = new ProjectDocument();
     doc.LoadXml(initialText);
     xmlView   = Substitute.For <IXmlView>();
     presenter = new XmlPresenter(doc, xmlView);
     presenter.LoadViewFromModel();
 }
 public void Initialize()
 {
     doc = new ProjectDocument();
     doc.LoadXml(initialText);
     xmlView = Substitute.For<IXmlView>();
     presenter = new XmlPresenter(doc, xmlView);
     presenter.LoadViewFromModel();
 }
Exemplo n.º 9
0
        protected DocumentCompositeNode GetRootNode(IProjectDocument projectDocument, bool checkForParseErrors)
        {
            SceneDocument sceneDocument = this.GetSceneDocument(projectDocument, checkForParseErrors);

            if (sceneDocument != null)
            {
                return(sceneDocument.DocumentRoot.RootNode as DocumentCompositeNode);
            }
            return((DocumentCompositeNode)null);
        }
Exemplo n.º 10
0
        public SceneDocument GetSceneDocument(string path)
        {
            IProjectDocument projectDocument = this.xamlDocument.ProjectContext.OpenDocument(path);

            if (projectDocument != null)
            {
                return(projectDocument.Document as SceneDocument);
            }
            return((SceneDocument)null);
        }
Exemplo n.º 11
0
 internal static SceneDocument GetApplicationDocument(IProjectContext activeContext)
 {
     if (activeContext != null)
     {
         IProjectDocument application = activeContext.Application;
         if (application != null)
         {
             return(application.Document as SceneDocument);
         }
     }
     return((SceneDocument)null);
 }
Exemplo n.º 12
0
        public static void Initialize(TestContext context)
        {
            doc = new CSharpProjectDocument()
            {
                ProjectPath = XmlDataPath
            };
            doc.Initialize();

            doc2 = new CSharpProjectDocument()
            {
                ProjectPath = XmlDataPath2
            };
            doc2.Initialize();
        }
Exemplo n.º 13
0
        protected SceneDocument GetSceneDocument(IProjectDocument projectDocument, bool checkForParseErrors)
        {
            if (projectDocument.Document == null)
            {
                this.ProjectContext.OpenDocument(projectDocument.Path);
            }
            SceneDocument sceneDocument = projectDocument.Document as SceneDocument;

            if (checkForParseErrors && sceneDocument.XamlDocument.ParseErrorsCount > 0)
            {
                return((SceneDocument)null);
            }
            return(sceneDocument);
        }
Exemplo n.º 14
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;
        }
Exemplo n.º 15
0
        private static int GetDocumentTypeOrder(IProjectDocument document)
        {
            switch (document.DocumentType)
            {
            case ProjectDocumentType.Application:
                return(1);

            case ProjectDocumentType.ResourceDictionary:
                return(2);

            case ProjectDocumentType.Page:
                return(0);

            default:
                return(3);
            }
        }
Exemplo n.º 16
0
        public override bool IsValidStartupItem(IProjectItem projectItem)
        {
            if (this.IsControlLibrary)
            {
                return(base.IsValidStartupItem(projectItem));
            }
            ProjectXamlContext projectContext = ProjectXamlContext.GetProjectContext((IProject)this);

            if (projectItem != null && projectContext != null)
            {
                IProjectDocument document = projectContext.GetDocument(DocumentReferenceLocator.GetDocumentLocator(projectItem.DocumentReference));
                if (document != null && document.DocumentType == ProjectDocumentType.Page)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 17
0
        public void SetUp()
        {
            doc = new ProjectDocument();
            doc.LoadXml(NUnitProjectXml.NormalProject);
            model = new ProjectModel(doc);
            model.ActiveConfigName = "Release";

            view = Substitute.For <IPropertyView>();
            view.ConfigList.Returns(new SelectionStub("ConfigList"));
            view.ProcessModel.Returns(new SelectionStub("ProcessModel"));
            view.DomainUsage.Returns(new SelectionStub("DomainUsage"));
            view.Runtime.Returns(new SelectionStub("Runtime"));
            view.RuntimeVersion.Returns(new SelectionStub("RuntimeVersion"));
            view.AssemblyList.Returns(new SelectionStub("AssemblyList"));

            presenter = new PropertyPresenter(model, view);
            presenter.LoadViewFromModel();
        }
Exemplo n.º 18
0
        public void SetUp()
        {
            doc = new ProjectDocument();
            doc.LoadXml(NUnitProjectXml.NormalProject);
            model = new ProjectModel(doc);
            model.ActiveConfigName = "Release";

            view = Substitute.For<IPropertyView>();
            view.ConfigList.Returns(new SelectionStub("ConfigList"));
            view.ProcessModel.Returns(new SelectionStub("ProcessModel"));
            view.DomainUsage.Returns(new SelectionStub("DomainUsage"));
            view.Runtime.Returns(new SelectionStub("Runtime"));
            view.RuntimeVersion.Returns(new SelectionStub("RuntimeVersion"));
            view.AssemblyList.Returns(new SelectionStub("AssemblyList"));

            presenter = new PropertyPresenter(model, view);
            presenter.LoadViewFromModel();
        }
Exemplo n.º 19
0
        protected override sealed void Work()
        {
            IProjectDocument projectDocument = this.ProjectDocuments[this.currentViewIndex];

            if (projectDocument == null)
            {
                return;
            }
            bool flag = false;

            if (projectDocument.Document == null)
            {
                IXamlProject xamlProject = this.designerContext.ProjectManager.CurrentSolution.FindProjectContainingItem(DocumentReference.Create(projectDocument.Path)) as IXamlProject;
                if (xamlProject == null)
                {
                    return;
                }
                try
                {
                    projectDocument = xamlProject.ProjectContext.OpenDocument(projectDocument.Path);
                }
                catch (NotSupportedException ex)
                {
                    return;
                }
                flag = true;
                if (projectDocument == null)
                {
                    return;
                }
            }
            SceneDocument document = projectDocument.Document as SceneDocument;

            if (document == null || !document.IsEditable)
            {
                return;
            }
            this.ProcessDocument(document);
            if (!flag)
            {
                return;
            }
            this.CloseDocument(document);
        }
Exemplo n.º 20
0
        private void OnProjectContextDocumentClosedEarly(object sender, ProjectDocumentEventArgs e)
        {
            IProjectDocument document      = e.Document;
            SceneDocument    sceneDocument = e.Document.Document as SceneDocument;

            if (sceneDocument == null)
            {
                return;
            }
            List <SceneView> list1 = (List <SceneView>)null;

            if (this.primaryViewsForDocument.TryGetValue(sceneDocument, out list1))
            {
                foreach (SceneView sceneView in new List <SceneView>((IEnumerable <SceneView>)list1))
                {
                    sceneView.SuspendUpdatesForViewShutdown();
                    this.Unregister(sceneView);
                }
            }
            List <SceneView> list2 = (List <SceneView>)null;

            if (!this.relatedViewsForDocument.TryGetValue(sceneDocument, out list2))
            {
                return;
            }
            List <SceneView> list3 = new List <SceneView>((IEnumerable <SceneView>)list2);

            foreach (SceneView sceneView in list3)
            {
                ViewUpdateManager.RelatedDocumentTable relatedDocumentTable = this.relatedDocumentsForView[sceneView];
                this.UnregisterRelatedDocumentInternal(sceneView, sceneDocument);
                relatedDocumentTable.Remove(sceneDocument);
            }
            List <SceneView> list4;

            if (!this.pendingViewsForClosedDocuments.TryGetValue(e.Document, out list4))
            {
                this.pendingViewsForClosedDocuments.Add(e.Document, list3);
            }
            else
            {
                list4.AddRange(Enumerable.Except <SceneView>((IEnumerable <SceneView>)list3, (IEnumerable <SceneView>)list4));
            }
        }
Exemplo n.º 21
0
        private bool EnsureDataSourceReachable(SceneNode targetNode, DataSourceNode dataSource)
        {
            if (!targetNode.ViewModel.Document.HasOpenTransaction || new ExpressionEvaluator(targetNode.ViewModel.DocumentRootResolver).EvaluateResource(targetNode.DocumentNodePath, ResourceReferenceType.Static, dataSource.ResourceKey) != null)
            {
                return(true);
            }
            IProjectDocument projectDocument = targetNode.ProjectContext.OpenDocument(dataSource.DocumentNode.Context.DocumentUrl);

            if (projectDocument == null || projectDocument.DocumentType != ProjectDocumentType.ResourceDictionary)
            {
                return(false);
            }
            SceneDocument   resourceDictionary1 = projectDocument.Document as SceneDocument;
            ResourceManager resourceManager     = targetNode.ViewModel.DesignerContext.ResourceManager;
            ResourceDictionaryContentProvider resourceDictionary2 = resourceManager.FindContentProviderForResourceDictionary(resourceDictionary1);
            ResourceContainer resourceContainer = resourceManager.FindResourceContainer(targetNode.DocumentContext.DocumentUrl);

            return(resourceDictionary2.EnsureLinked(targetNode.ViewModel, resourceContainer));
        }
Exemplo n.º 22
0
        public override bool ReferencesDocument(DocumentReference documentReference)
        {
            bool             flag     = false;
            DocumentNode     rootNode = this.DocumentRoot.RootNode;
            IProjectDocument document = this.ProjectContext.GetDocument(DocumentReferenceLocator.GetDocumentLocator(documentReference));

            if (rootNode != null && document != null && document.DocumentType == ProjectDocumentType.ResourceDictionary)
            {
                foreach (DocumentNode node in rootNode.DescendantNodes)
                {
                    if (this.DoesNodeReferenceUrl(node, documentReference.Path))
                    {
                        flag = true;
                        break;
                    }
                }
            }
            return(flag);
        }
Exemplo n.º 23
0
            protected override void Work()
            {
                IProjectDocument projectDocument = this.model.ResourceEntryNode.ProjectContext.OpenDocument(this.documentPaths[this.documentPathIndex]);

                if (projectDocument == null)
                {
                    return;
                }
                SceneDocument sceneDocument = projectDocument.Document as SceneDocument;

                if (sceneDocument == null)
                {
                    return;
                }
                SceneViewModel sceneViewModel = (SceneViewModel)null;
                ISceneViewHost sceneViewHost  = (ISceneViewHost)sceneDocument.ProjectContext.GetService(typeof(ISceneViewHost));

                if (sceneViewHost != null)
                {
                    SceneView sceneView = sceneViewHost.OpenView(sceneDocument.DocumentRoot, false);
                    sceneViewModel = sceneView != null ? sceneView.ViewModel : (SceneViewModel)null;
                }
                if (sceneViewModel == null)
                {
                    return;
                }
                List <SceneNode> list = new List <SceneNode>();

                sceneViewModel.FindInternalResourceReferences((DocumentCompositeNode)this.model.ResourceEntryNode.DocumentNode, (ICollection <SceneNode>)list);
                if (list.Count <= 0)
                {
                    return;
                }
                using (SceneEditTransaction editTransaction = sceneDocument.CreateEditTransaction(StringTable.ReferencesFixupEditTransaction))
                {
                    foreach (SceneNode reference in list)
                    {
                        this.model.FixupIndividualReference((DocumentCompositeNode)this.model.ResourceEntryNode.DocumentNode, reference);
                    }
                    editTransaction.Commit();
                }
            }
Exemplo n.º 24
0
        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);
        }
Exemplo n.º 25
0
        public MainPresenter(IProjectDocument doc, IMainView view)
        {
            this.doc  = doc;
            this.view = view;

            // Set up property editor triad
            ProjectModel  project      = new ProjectModel(doc);
            IPropertyView propertyView = view.PropertyView;

            this.propertyPresenter = new PropertyPresenter(project, propertyView);

            // Set up XML editor triad
            IXmlView xmlView = view.XmlView;

            this.xmlPresenter = new XmlPresenter(doc, xmlView);

            // Enable and disable menu items
            view.NewProjectCommand.Enabled    = true;
            view.OpenProjectCommand.Enabled   = true;
            view.CloseProjectCommand.Enabled  = false;
            view.SaveProjectCommand.Enabled   = false;
            view.SaveProjectAsCommand.Enabled = false;

            // Set up handlers for view events
            view.FormClosing += OnFormClosing;

            view.NewProjectCommand.Execute    += CreateNewProject;
            view.OpenProjectCommand.Execute   += OpenProject;
            view.SaveProjectCommand.Execute   += SaveProject;
            view.SaveProjectAsCommand.Execute += SaveProjectAs;
            view.CloseProjectCommand.Execute  += CloseProject;
            view.ActiveViewChanging           += this.ValidateActiveViewChange;
            view.ActiveViewChanged            += this.ActiveViewChanged;

            // Set up handlers for model events
            doc.ProjectCreated += OnProjectCreated;
            doc.ProjectClosed  += OnProjectClosed;
        }
Exemplo n.º 26
0
 private void AddValueConverters(ResourceDictionaryNode resourceDictionary, List <ValueConverterModel> converters, List <SceneDocument> visitedDocuments)
 {
     foreach (DictionaryEntryNode dictionaryEntryNode in resourceDictionary)
     {
         ValueConverterModel valueConverter = ValueConverterModelFactory.CreateValueConverterModel((SceneNode)dictionaryEntryNode);
         if (valueConverter != null && converters.Find((Predicate <ValueConverterModel>)(vc => vc.DisplayName == valueConverter.DisplayName)) == null)
         {
             converters.Add(valueConverter);
         }
     }
     foreach (ResourceDictionaryNode resourceDictionaryNode in (IEnumerable <ResourceDictionaryNode>)resourceDictionary.MergedDictionaries)
     {
         string designTimeSource = resourceDictionaryNode.DesignTimeSource;
         if (!string.IsNullOrEmpty(designTimeSource))
         {
             IProjectDocument projectDocument = this.TargetElement.ProjectContext.OpenDocument(designTimeSource);
             if (projectDocument != null)
             {
                 this.AddDocumentConverters(projectDocument.Document as SceneDocument, converters, visitedDocuments);
             }
         }
     }
 }
Exemplo n.º 27
0
        public MainPresenter(IProjectDocument doc, IMainView view)
        {
            this.doc = doc;
            this.view = view;

            // Set up property editor triad
            ProjectModel project = new ProjectModel(doc);
            IPropertyView propertyView = view.PropertyView;
            this.propertyPresenter = new PropertyPresenter(project, propertyView);

            // Set up XML editor triad
            IXmlView xmlView = view.XmlView;
            this.xmlPresenter = new XmlPresenter(doc, xmlView);

            // Enable and disable menu items
            view.NewProjectCommand.Enabled = true;
            view.OpenProjectCommand.Enabled = true;
            view.CloseProjectCommand.Enabled = false;
            view.SaveProjectCommand.Enabled = false;
            view.SaveProjectAsCommand.Enabled = false;

            // Set up handlers for view events
            view.FormClosing += OnFormClosing;

            view.NewProjectCommand.Execute += CreateNewProject;
            view.OpenProjectCommand.Execute += OpenProject;
            view.SaveProjectCommand.Execute += SaveProject;
            view.SaveProjectAsCommand.Execute += SaveProjectAs;
            view.CloseProjectCommand.Execute += CloseProject;
            view.ActiveViewChanging += this.ValidateActiveViewChange;
            view.ActiveViewChanged += this.ActiveViewChanged;

            // Set up handlers for model events
            doc.ProjectCreated += OnProjectCreated;
            doc.ProjectClosed += OnProjectClosed;
        }
Exemplo n.º 28
0
        public override bool ShouldInstantiatePreviewControl(IDocumentRoot documentRoot)
        {
            if (base.ShouldInstantiatePreviewControl(documentRoot))
            {
                return(true);
            }
            IProjectDocument projectDocument = this.viewModel.ProjectContext.OpenDocument(documentRoot.DocumentContext.DocumentUrl);

            if (projectDocument != null && projectDocument.IsDirty)
            {
                return(true);
            }
            IAssembly projectAssembly = documentRoot.TypeResolver.ProjectAssembly;

            if (projectAssembly.IsLoaded)
            {
                FileInfo fileInfo = new FileInfo(projectAssembly.Location);
                if (fileInfo.Exists && projectDocument != null)
                {
                    return(new FileInfo(projectDocument.Path).LastWriteTimeUtc > fileInfo.LastWriteTimeUtc);
                }
            }
            return(false);
        }
Exemplo n.º 29
0
 public ProjectDocumentEventArgs(IProjectDocument document)
 {
     this.document = document;
 }
Exemplo n.º 30
0
 public ProjectModel(IProjectDocument doc)
 {
     this.doc = doc;
 }
Exemplo n.º 31
0
 public ProjectModel(IProjectDocument doc)
 {
     this.doc = doc;
 }
Exemplo n.º 32
0
        private DocumentCompositeNode ApplyChangesInternal(IList <SampleDataChange> normalizedChanges, DocumentCompositeNode rootNode, IProjectDocument projectDocument, bool editInPlace)
        {
            this.valueBuilder = new SampleDataValueBuilderBase(normalizedChanges[0].DeclaringDataSet, rootNode.Context);
            DocumentCompositeNode rootNode1 = rootNode;

            using (((SceneDocument)projectDocument.Document).CreateEditTransaction("", true))
            {
                this.ProcessDeletedTypes(normalizedChanges, rootNode1);
                this.ProcessDeletedProperties(normalizedChanges, rootNode1);
                this.ProcessCreatedProperties(normalizedChanges, rootNode1);
                this.ProcessPropertyTypeOrFormatChanges(normalizedChanges, rootNode1);
                if (!editInPlace)
                {
                    if (this.changeCount > 0)
                    {
                        rootNode1 = (DocumentCompositeNode)rootNode.Clone(rootNode1.Context);
                        rootNode1.SourceContext = (INodeSourceContext)null;
                    }
                }
            }
            return(rootNode1);
        }
Exemplo n.º 33
0
 public void Initialize()
 {
     view      = Substitute.For <IMainView>();
     doc       = new ProjectDocument();
     presenter = new MainPresenter(doc, view);
 }
Exemplo n.º 34
0
 public static DocumentCompositeNode ApplyChanges(IList <SampleDataChange> normalizedChanges, DocumentCompositeNode rootNode, IProjectDocument projectDocument, bool editInPlace)
 {
     if (normalizedChanges.Count == 0 || rootNode == null)
     {
         return((DocumentCompositeNode)null);
     }
     return(new SampleDataValueChangeProcessor().ApplyChangesInternal(normalizedChanges, rootNode, projectDocument, editInPlace));
 }
Exemplo n.º 35
0
 public void Initialize()
 {
     view = Substitute.For<IMainView>();
     doc = new ProjectDocument();
     presenter = new MainPresenter(doc, view);
 }
Exemplo n.º 36
0
        private static ViewUpdateManager.DocumentRelation GetDocumentRelation(SceneView sceneView, IProjectDocument projectDocument)
        {
            if (projectDocument == null)
            {
                return(ViewUpdateManager.DocumentRelation.Unrelated);
            }
            if (projectDocument.DocumentType == ProjectDocumentType.Application || projectDocument.DocumentType == ProjectDocumentType.ResourceDictionary || projectDocument.DocumentRoot != null && projectDocument.DocumentRoot.RootNode != null && PlatformTypes.UserControl.IsAssignableFrom((ITypeId)projectDocument.DocumentRoot.RootNode.Type))
            {
                return(ViewUpdateManager.DocumentRelation.Related);
            }
            string        withoutExtension = Path.GetFileNameWithoutExtension(projectDocument.Path);
            SampleDataSet sampleDataSet    = sceneView.SampleData.GetSampleDataSet(withoutExtension, true);

            if (sampleDataSet == null)
            {
                return(DocumentContextHelper.GetDesignDataMode(ProjectHelper.GetProject(sceneView.DesignerContext.ProjectManager, sceneView.Document.DocumentContext), projectDocument.Path) != DesignDataMode.None ? ViewUpdateManager.DocumentRelation.Related : ViewUpdateManager.DocumentRelation.Unrelated);
            }
            if (!sampleDataSet.XamlFilePath.Equals(projectDocument.Path, StringComparison.OrdinalIgnoreCase))
            {
                return(ViewUpdateManager.DocumentRelation.Unrelated);
            }
            return(!sampleDataSet.IsOnline ? ViewUpdateManager.DocumentRelation.OfflineSampleData : ViewUpdateManager.DocumentRelation.Related);
        }