private static void AddFolderForFile(Dictionary<FileNode, List<CommonFolderNode>> directoryPackages, FileNode rootFile, CommonFolderNode folderChild) { List<CommonFolderNode> folders; if (!directoryPackages.TryGetValue(rootFile, out folders)) { directoryPackages[rootFile] = folders = new List<CommonFolderNode>(); } folders.Add(folderChild); }
/// <summary> /// Rename all childnodes /// </summary> /// <param name="newFileNode">The newly added Parent node.</param> protected virtual void RenameChildNodes(FileNode parentNode) { foreach (var childNode in GetChildNodes().OfType<FileNode>()) { string newfilename; if (childNode.HasParentNodeNameRelation) { string relationalName = childNode.Parent.GetRelationalName(); string extension = childNode.GetRelationNameExtension(); newfilename = relationalName + extension; newfilename = CommonUtils.GetAbsoluteFilePath(Path.GetDirectoryName(childNode.Parent.GetMkDocument()), newfilename); } else { newfilename = CommonUtils.GetAbsoluteFilePath(Path.GetDirectoryName(childNode.Parent.GetMkDocument()), childNode.GetEditLabel()); } childNode.RenameDocument(childNode.GetMkDocument(), newfilename); //We must update the DependsUpon property since the rename operation will not do it if the childNode is not renamed //which happens if the is no name relation between the parent and the child string dependentOf = childNode.ItemNode.GetMetadata(ProjectFileConstants.DependentUpon); if (!string.IsNullOrEmpty(dependentOf)) { childNode.ItemNode.SetMetadata(ProjectFileConstants.DependentUpon, childNode.Parent.ItemNode.GetMetadata(ProjectFileConstants.Include)); } } }
/// <summary> /// Update the ChildNodes after the parent node has been renamed /// </summary> /// <param name="newFileNode">The new FileNode created as part of the rename of this node</param> private void SetNewParentOnChildNodes(FileNode newFileNode) { foreach (HierarchyNode childNode in GetChildNodes()) { childNode.Parent = newFileNode; } }
internal void UnregisterFileChangeNotification(FileNode node) { _fileChangedHandlers.Remove(node.Url); }
protected override void RenameChildNodes(FileNode parentNode) { base.RenameChildNodes(parentNode); this.ProjectMgr.Analyzer.ReloadComplete(); }
internal void RegisterFileChangeNotification(FileNode node, FileSystemEventHandler handler) { _fileChangedHandlers[node.Url] = handler; }
public FileDocumentManager(FileNode node) : base(node) { }
public void CacheCompletions(FileNode node, CompletionInfo[] completions) { _cachedEntries[node] = completions; }
public bool TryGetCompletions(FileNode node, out CompletionInfo[] result) { return _cachedEntries.TryGetValue(node, out result); }