private void ApplyChangesToExternalDocuments(IProjectContext projectContext)
        {
            Dictionary <IDocumentRoot, List <PathChange> > dictionary = new Dictionary <IDocumentRoot, List <PathChange> >();

            for (int index = this.pathChanges.Count - 1; index >= 0; --index)
            {
                PathChange pathChange = this.pathChanges[index];
                if ((IProjectContext)pathChange.DocumentNode.TypeResolver != projectContext)
                {
                    List <PathChange> list;
                    if (!dictionary.TryGetValue(pathChange.DocumentNode.DocumentRoot, out list))
                    {
                        list = new List <PathChange>();
                        dictionary[pathChange.DocumentNode.DocumentRoot] = list;
                    }
                    list.Add(pathChange);
                    this.pathChanges.RemoveAt(index);
                }
            }
            foreach (KeyValuePair <IDocumentRoot, List <PathChange> > keyValuePair in dictionary)
            {
                IDocumentRoot key = keyValuePair.Key;
                this.ApplyChangesInternal(((IProjectContext)key.DocumentContext.TypeResolver).OpenDocument(key.DocumentContext.DocumentUrl).Document as SceneDocument, keyValuePair.Value);
            }
        }
Esempio n. 2
0
        public void GetRevisionData_Revision16_CopiedPath()
        {
            PathChange change = GetPathChangeList(16)[0];

            Assert.That(change.Change, Is.EqualTo(Change.Add));
            Assert.That(change.Path, Is.EqualTo("/CopyWithDeletedFolder"));
            Assert.That(change.IsCopy);
        }
Esempio n. 3
0
 void QueueAnalyzeJob(PathChange change)
 {
     if (IgnorePath(change.Path))
     {
         return;
     }
     QueueAnalyzeJob(new AnalyzeJobData {
         Change = change, Recursive = false
     });
 }
        public void ApplyChanges(SceneDocument sceneDocument)
        {
            List <PathChange> documentChanges = new List <PathChange>();

            for (int index = this.pathChanges.Count - 1; index >= 0; --index)
            {
                PathChange pathChange = this.pathChanges[index];
                if (pathChange.DocumentNode.DocumentRoot == this.DocumentRoot)
                {
                    documentChanges.Add(pathChange);
                    this.pathChanges.RemoveAt(index);
                }
            }
            this.ApplyChangesInternal(sceneDocument, documentChanges);
            this.ApplyChangesToExternalDocuments(sceneDocument.ProjectContext);
        }
Esempio n. 5
0
 void syncPathChange(PathChange pc)
 {
     Synchronizer.sync(pc)
         .Wait();
 }
 void syncFile(PathChange pc)
 {
     FileSynchronizer.syncFile(pc, _sourceInfo.Object, _targetInfo.Object)
         .Wait();
 }