void IDiskBasedNode.RenameForDeferredSave(string basePath, string baseNewPath) { string oldPath = Path.Combine(basePath, ItemNode.GetMetadata(ProjectFileConstants.Include)); string newPath = Path.Combine(baseNewPath, ItemNode.GetMetadata(ProjectFileConstants.Include)); Directory.CreateDirectory(newPath); ProjectMgr.UpdatePathForDeferredSave(oldPath, newPath); }
public AssembleFileNode(ProjectNode root, ProjectElement e) : base(root, e) { ExcludeNodeFromScc = true; // Give it a guid if it does not already have one. if (string.IsNullOrEmpty(ItemNode.GetMetadata(Constants.Project.Item.Assemble.Guid.Name))) { ItemNode.SetMetadata(Constants.Project.Item.Assemble.Guid.Name, System.Guid.NewGuid().ToString("B")); } }
void IDiskBasedNode.RenameForDeferredSave(string basePath, string baseNewPath) { string oldLoc = CommonUtils.GetAbsoluteFilePath(basePath, ItemNode.GetMetadata(ProjectFileConstants.Include)); string newLoc = CommonUtils.GetAbsoluteFilePath(baseNewPath, ItemNode.GetMetadata(ProjectFileConstants.Include)); ProjectMgr.UpdatePathForDeferredSave(oldLoc, newLoc); // make sure the directory is there Directory.CreateDirectory(Path.GetDirectoryName(newLoc)); if (File.Exists(oldLoc)) { File.Move(oldLoc, newLoc); } }
protected string GetRelativePath() { string relativePath = Path.GetFileName(ItemNode.GetMetadata(ProjectFileConstants.Include)); HierarchyNode parent = Parent; while (parent != null && !(parent is ProjectNode)) { relativePath = Path.Combine(parent.Caption, relativePath); parent = parent.Parent; } return(relativePath); }
public ConfigReferenceNode(ProjectNode root, ProjectElement e) : base(root, e) { m_name = ItemNode.GetMetadata(ProjectFileConstants.Include); m_hintPath = ItemNode.GetMetadata("HintPath"); }