Пример #1
0
        internal void DisableAutoImport(BaseFileNode node)
        {
            var orphans = ModuleTracker.DisableTracking(node.Url);

            foreach (string mod in orphans)
            {
                TreeOperations.RemoveSubnodeFromHierarchy(this, mod, false);
            }
        }
Пример #2
0
        internal void OnNodeDirty(uint id)
        {
            BaseFileNode dirtyNode = this.NodeFromItemId(id) as BaseFileNode;

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