Example #1
0
        static void FileRenamed(object sender, MonoDevelop.Projects.ProjectFileRenamedEventArgs args)
        {
            bool changed = false;

            foreach (NavigationHistoryItem point in history)
            {
                DocumentNavigationPoint dp = point.NavigationPoint as DocumentNavigationPoint;
                changed &= (dp != null && dp.HandleRenameEvent(args.OldName, args.NewName));
            }
            if (changed)
            {
                OnHistoryChanged();
            }
        }
Example #2
0
        void OnFileRenamed(object sender, MonoDevelop.Projects.ProjectFileRenamedEventArgs args)
        {
            if (internalChanges)
            {
                return;
            }
            var project = (MonoDevelop.Projects.Project)sender;

            foreach (MonoDevelop.Projects.ProjectFileRenamedEventInfo fargs in args)
            {
                var projectFile = fargs.ProjectFile;
                if (projectFile.Subtype == MonoDevelop.Projects.Subtype.Directory)
                {
                    continue;
                }
                if (!TypeSystemParserNode.IsCompileBuildAction(projectFile.BuildAction))
                {
                    continue;
                }

                var projectId = GetProjectId(project);
                var data      = GetProjectData(projectId);

                var id = data.GetDocumentId(fargs.OldName);
                if (id != null)
                {
                    if (this.IsDocumentOpen(id))
                    {
                        this.InformDocumentClose(id, fargs.OldName);
                    }
                    OnDocumentRemoved(id);
                    data.RemoveDocument(fargs.OldName);
                }

                var newDocument = CreateDocumentInfo(solutionData, project.Name, GetProjectData(projectId), projectFile);
                OnDocumentAdded(newDocument);
            }
        }
 void FileRenamedInProject(object sender, MonoDevelop.Projects.ProjectFileRenamedEventArgs e)
 {
     cache.Remove(e.OldName);
 }