示例#1
0
        protected override void RenameEnded()
        {
            int userData = base.GetRenameOverlay().userData;

            ProjectBrowser.ItemType itemType = ProjectBrowser.GetItemType(userData);
            if (this.m_IsCreatingSavedFilter)
            {
                this.m_IsCreatingSavedFilter = false;
                if (base.GetRenameOverlay().userAcceptedRename)
                {
                    SavedSearchFilters.SetName(userData, base.GetRenameOverlay().name);
                    int[] selectedIDs = new int[] { userData };
                    base.m_TreeView.SetSelection(selectedIDs, true);
                }
                else
                {
                    SavedSearchFilters.RemoveSavedFilter(userData);
                }
            }
            else if (itemType == ProjectBrowser.ItemType.SavedFilter)
            {
                if (base.GetRenameOverlay().userAcceptedRename)
                {
                    SavedSearchFilters.SetName(userData, base.GetRenameOverlay().name);
                }
            }
            else
            {
                base.RenameEnded();
                if (base.GetRenameOverlay().userAcceptedRename)
                {
                    base.m_TreeView.NotifyListenersThatSelectionChanged();
                }
            }
        }
        override protected void RenameEnded()
        {
            int instanceID = GetRenameOverlay().userData;

            ProjectBrowser.ItemType type = ProjectBrowser.GetItemType(instanceID);

            if (m_IsCreatingSavedFilter)
            {
                // Create saved filter
                m_IsCreatingSavedFilter = false;

                if (GetRenameOverlay().userAcceptedRename)
                {
                    SavedSearchFilters.SetName(instanceID, GetRenameOverlay().name);
                    m_TreeView.SetSelection(new[] { instanceID }, true);
                }
                else
                {
                    SavedSearchFilters.RemoveSavedFilter(instanceID);
                }
            }
            else if (type == ProjectBrowser.ItemType.SavedFilter)
            {
                // Renamed saved filter
                if (GetRenameOverlay().userAcceptedRename)
                {
                    SavedSearchFilters.SetName(instanceID, GetRenameOverlay().name);
                }
            }
            else
            {
                // Let base handle renaming of folders
                base.RenameEnded();

                // Ensure to sync filter to new folder name (so we still show the contents of the folder)
                if (GetRenameOverlay().userAcceptedRename)
                {
                    m_TreeView.NotifyListenersThatSelectionChanged();
                }
            }
        }
示例#3
0
        protected override void RenameEnded()
        {
            int userData = this.GetRenameOverlay().userData;

            ProjectBrowser.ItemType itemType = ProjectBrowser.GetItemType(userData);
            if (this.m_IsCreatingSavedFilter)
            {
                this.m_IsCreatingSavedFilter = false;
                if (this.GetRenameOverlay().userAcceptedRename)
                {
                    SavedSearchFilters.SetName(userData, this.GetRenameOverlay().name);
                    this.m_TreeView.SetSelection(new int[1] {
                        userData
                    }, 1 != 0);
                }
                else
                {
                    SavedSearchFilters.RemoveSavedFilter(userData);
                }
            }
            else if (itemType == ProjectBrowser.ItemType.SavedFilter)
            {
                if (!this.GetRenameOverlay().userAcceptedRename)
                {
                    return;
                }
                SavedSearchFilters.SetName(userData, this.GetRenameOverlay().name);
            }
            else
            {
                base.RenameEnded();
                if (!this.GetRenameOverlay().userAcceptedRename)
                {
                    return;
                }
                this.m_TreeView.NotifyListenersThatSelectionChanged();
            }
        }