Exemplo n.º 1
0
        public void FireOnProjectItemRemoved(object sender, ProjectItemRemovedEventArgs eventArgs)
        {
            _log.Info("OnProjectItemRemoved");

            if (null != OnProjectItemRemoved)
            {
                OnProjectItemRemoved(sender, eventArgs);
            }
        }
        private void ConnPane_OnProjectItemRemoved(object sender, ProjectItemRemovedEventArgs e)
        {
            ProjectItem projectItem = e.ProjectItem;

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

            if (projectPath == null)
            {
                return;
            }

            Guid itemType = new Guid(projectItem.Kind);

            if (itemType == VSConstants.GUID_ItemType_PhysicalFile)
            {
                string itemName = FileSystem.LocalPathToCrmPath(projectPath, projectItem.FileNames[1]);

                //UpdateWebResourceItemsBoundFile(itemName, null);

                //UpdateProjectFilesAfterChange(itemName, null);
            }

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

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

                //UpdateWebResourceItemsBoundFilePath(itemName, null);

                //UpdateProjectFilesPathsAfterChange(itemName, null);
            }
        }
Exemplo n.º 3
0
        public static ObservableCollection <string> FolderRemoved(ProjectItemRemovedEventArgs e, ObservableCollection <string> projectFolders)
        {
            var projectItem = e.ProjectItem;

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

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

            var itemType = new Guid(projectItem.Kind);

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

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

            projectFolders.Remove(itemName);

            return(new ObservableCollection <string>(projectFolders.OrderBy(s => s)));
        }