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

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

            if (dirtyNode != null && dirtyNode.GetModuleTracking())
            {
                ReparseFileNode(dirtyNode);
            }
        }
Exemplo 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));
            }
        }
Exemplo 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));
            }
        }
Exemplo 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));
        }
Exemplo 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);
                }
            }
        }
Exemplo 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));
     }
 }
Exemplo 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);
         }
     }
 }
Exemplo 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));
     }
 }
Exemplo n.º 10
0
 internal void DisableAutoImport(BaseFileNode node)
 {
     var orphans = ModuleTracker.DisableTracking(node.Url);
     foreach (string mod in orphans)
     {
         TreeOperations.RemoveSubnodeFromHierarchy(this, mod, false);
     }
 }