Esempio n. 1
0
        internal void DisableAutoImport(BaseFileNode node)
        {
            var orphans = ModuleTracker.DisableTracking(node.Url);

            foreach (string mod in orphans)
            {
                TreeOperations.RemoveSubnodeFromHierarchy(this, mod, false);
            }
        }
Esempio n. 2
0
        internal void OnNodeDirty(uint id)
        {
            BaseFileNode dirtyNode = this.NodeFromItemId(id) as BaseFileNode;

            if (dirtyNode != null && dirtyNode.GetModuleTracking())
            {
                ReparseFileNode(dirtyNode);
            }
        }
Esempio n. 3
0
        internal void EnableAutoImport(BaseFileNode node)
        {
            var newMods = ModuleTracker.EnableTracking(node.Url);

            foreach (string mod in newMods)
            {
                HierarchyNode parent = this.CreateFolderNodes(Path.GetDirectoryName(mod), false);
                parent.AddChild(CreateUntrackedNode(mod));
            }
        }
Esempio n. 4
0
        internal void ReparseFileNode(BaseFileNode n)
        {
            var diff = ModuleTracker.Reparse(n.Url);

            foreach (string mod in diff.Removed)
            {
                TreeOperations.RemoveSubnodeFromHierarchy(this, mod, false);
            }
            foreach (string mod in diff.Added)
            {
                HierarchyNode parent = this.CreateFolderNodes(Path.GetDirectoryName(mod), false);
                parent.AddChild(CreateUntrackedNode(mod));
            }
        }
Esempio n. 5
0
        public override int SaveItem(VSSAVEFLAGS saveFlag, string silentSaveAsName, uint itemid, IntPtr docData, out int cancelled)
        {
            BaseFileNode node = this.NodeFromItemId(itemid) as BaseFileNode;

            if (node != null)
            {
                int result = base.SaveItem(saveFlag, silentSaveAsName, itemid, docData, out cancelled);
                if (result == VSConstants.S_OK)
                {
                    ReparseFileNode(node);
                }
                return(result);
            }
            return(base.SaveItem(saveFlag, silentSaveAsName, itemid, docData, out cancelled));
        }
Esempio n. 6
0
        internal void ExcludeFileNode(BaseFileNode srcNode)
        {
            // Ask mod tracker for a professional opinion
            string fullPath = srcNode.Url;
            ModuleRemovalResult downgradeResult = ModuleTracker.DowngradeModule(fullPath);

            if (downgradeResult.IsReferenced)
            {
                TreeOperations.Replace(this, srcNode, () => CreateUntrackedNode(fullPath));
            }
            else
            {
                foreach (string path in downgradeResult.Orphans)
                {
                    TreeOperations.RemoveSubnodeFromHierarchy(this, path, false);
                }
            }
        }
Esempio n. 7
0
 internal void ReparseFileNode(BaseFileNode n)
 {
     var diff = ModuleTracker.Reparse(n.Url);
     foreach (string mod in diff.Removed)
     {
         TreeOperations.RemoveSubnodeFromHierarchy(this, mod, false);
     }
     foreach (string mod in diff.Added)
     {
         HierarchyNode parent = this.CreateFolderNodes(fs.Path.GetDirectoryName(mod), false);
         parent.AddChild(CreateUntrackedNode(mod));
     }
 }
Esempio n. 8
0
 internal void ExcludeFileNode(BaseFileNode srcNode)
 {
     // Ask mod tracker for a professional opinion
     string fullPath = srcNode.Url;
     ModuleRemovalResult downgradeResult = ModuleTracker.DowngradeModule(fullPath);
     if (downgradeResult.IsReferenced)
     {
         TreeOperations.Replace(this, srcNode, () => CreateUntrackedNode(fullPath));
     }
     else
     {
         foreach (string path in downgradeResult.Orphans)
         {
             TreeOperations.RemoveSubnodeFromHierarchy(this, path, false);
         }
     }
 }
Esempio n. 9
0
 internal void EnableAutoImport(BaseFileNode node)
 {
     var newMods = ModuleTracker.EnableTracking(node.Url);
     foreach (string mod in newMods)
     {
         HierarchyNode parent = this.CreateFolderNodes(fs.Path.GetDirectoryName(mod), false);
         parent.AddChild(CreateUntrackedNode(mod));
     }
 }
Esempio n. 10
0
 internal void DisableAutoImport(BaseFileNode node)
 {
     var orphans = ModuleTracker.DisableTracking(node.Url);
     foreach (string mod in orphans)
     {
         TreeOperations.RemoveSubnodeFromHierarchy(this, mod, false);
     }
 }