/// <summary>
 /// Let's follow file name changes
 /// </summary>
 private void OnProjectItemRenamed(object sender, ProjectItemRenamedEventArgs args)
 {
     if (args.OldName == FilePath)
     {
         FilePath = args.NewName;
     }
 }
 /// <summary>
 /// Responds to the event when an item has been renamed
 /// </summary>
 private void OnProjectItemRenamed(object sender, ProjectItemRenamedEventArgs args)
 {
     // --- Let's change tagger names
     if (Z80AsmTaggers.TryGetValue(args.OldName, out var tagger))
     {
         Z80AsmTaggers.Remove(args.OldName);
         Z80AsmTaggers[args.NewName] = tagger;
     }
 }
Exemplo n.º 3
0
        public void FireOnProjectItemRenamed(object sender, ProjectItemRenamedEventArgs eventArgs)
        {
            _log.Info("OnProjectItemRenamed");

            if (null != OnProjectItemRenamed)
            {
                OnProjectItemRenamed(sender, eventArgs);
            }
        }
Exemplo n.º 4
0
        private void Project_ItemRenamed(object sender, ProjectItemRenamedEventArgs e)
        {
            ProjectItemNode projectItemNode = base.FindItemNode(e.ProjectItem);

            if (projectItemNode != null)
            {
                projectItemNode.OnRenamed();
            }
        }
        private void ConnPane_OnProjectItemRenamed(object sender, ProjectItemRenamedEventArgs e)
        {
            ProjectItem projectItem = e.ProjectItem;

            if (projectItem.Name == null)
            {
                return;
            }

            var projectPath = Path.GetDirectoryName(projectItem.ContainingProject.FullName);

            if (projectPath == null)
            {
                return;
            }
            string oldName  = e.OldName;
            Guid   itemType = new Guid(projectItem.Kind);

            if (itemType == VSConstants.GUID_ItemType_PhysicalFile)
            {
                string newItemName = FileSystem.LocalPathToCrmPath(projectPath, projectItem.FileNames[1]);
                string oldItemName = newItemName.Replace(Path.GetFileName(projectItem.Name), oldName).Replace("//", "/");

                //UpdateWebResourceItemsBoundFile(oldItemName, newItemName);

                //UpdateProjectFilesAfterChange(oldItemName, newItemName);
            }

            if (itemType == VSConstants.GUID_ItemType_PhysicalFolder)
            {
                var newItemPath = FileSystem.LocalPathToCrmPath(projectPath, projectItem.FileNames[1])
                                  .TrimEnd(Path.DirectorySeparatorChar);

                int index = newItemPath.LastIndexOf(projectItem.Name, StringComparison.Ordinal);
                if (index == -1)
                {
                    return;
                }

                var oldItemPath = newItemPath.Remove(index, projectItem.Name.Length).Insert(index, oldName);

                //UpdateWebResourceItemsBoundFilePath(oldItemPath, newItemPath);

                //UpdateProjectFilesPathsAfterChange(oldItemPath, newItemPath);
            }
        }
Exemplo n.º 6
0
        public static ObservableCollection <string> FolderRenamed(ProjectItemRenamedEventArgs e, ObservableCollection <string> projectFolders)
        {
            var projectItem = e.ProjectItem;

            if (projectItem.Name == null)
            {
                return(projectFolders);
            }

            var projectPath = Path.GetDirectoryName(projectItem.ContainingProject.FullName);

            if (projectPath == null)
            {
                return(projectFolders);
            }

            var oldName  = e.OldName;
            var itemType = new Guid(projectItem.Kind);

            if (itemType != VSConstants.GUID_ItemType_PhysicalFolder)
            {
                return(projectFolders);
            }

            var newItemPath = FileSystem.LocalPathToCrmPath(projectPath, projectItem.FileNames[1]);

            var index = newItemPath.LastIndexOf(projectItem.Name, StringComparison.Ordinal);

            if (index == -1)
            {
                return(projectFolders);
            }

            var oldItemPath = newItemPath.Remove(index, projectItem.Name.Length).Insert(index, oldName);

            projectFolders.Remove(oldItemPath);

            return(new ObservableCollection <string>(projectFolders.OrderBy(s => s)));
        }
Exemplo n.º 7
0
 private void Project_ItemRenamed(object sender, ProjectItemRenamedEventArgs e)
 {
     this.asyncManager.RemoveFile(e.ProjectItem);
     this.asyncManager.AddFile(e.ProjectItem);
 }