UnityEditor.ASHistoryFileView.DoDeletedItemsGUI C# (CSharp) Method

DoDeletedItemsGUI() public method

public DoDeletedItemsGUI ( ASHistoryWindow parentWin, Rect theRect, GUIStyle s, float offset, float endOffset, bool focused ) : void
parentWin ASHistoryWindow
theRect UnityEngine.Rect
s UnityEngine.GUIStyle
offset float
endOffset float
focused bool
return void
        public void DoDeletedItemsGUI(ASHistoryWindow parentWin, Rect theRect, GUIStyle s, float offset, float endOffset, bool focused)
        {
            Event current = Event.current;
            Texture2D textured = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
            offset += 3f;
            Rect position = new Rect(this.m_Indent, offset, theRect.width - this.m_Indent, m_RowHeight);
            if ((current.type == EventType.MouseDown) && position.Contains(current.mousePosition))
            {
                GUIUtility.keyboardControl = this.m_FileViewControlID;
                this.SelType = SelectionType.DeletedItemsRoot;
                this.ScrollToDeletedItem(-1);
                parentWin.DoLocalSelectionChange();
            }
            position.width -= position.x;
            position.x = 0f;
            GUIContent content = new GUIContent("Deleted Assets") {
                image = textured
            };
            int baseIndent = (int) this.m_BaseIndent;
            s.padding.left = baseIndent;
            if (current.type == EventType.Repaint)
            {
                s.Draw(position, content, false, false, this.SelType == SelectionType.DeletedItemsRoot, focused);
            }
            Rect rect2 = new Rect(this.m_BaseIndent - this.m_FoldoutSize, offset, this.m_FoldoutSize, m_RowHeight);
            if (!this.m_DeletedItemsInitialized || (this.m_DelPVstate.lv.totalRows != 0))
            {
                this.DeletedItemsToggle = GUI.Toggle(rect2, this.DeletedItemsToggle, GUIContent.none, ms_Styles.foldout);
            }
            offset += m_RowHeight;
            if (this.DeletedItemsToggle)
            {
                int row = this.m_DelPVstate.lv.row;
                int index = 0;
                int num4 = -1;
                int file = -1;
                int num6 = 0;
                while ((offset <= endOffset) && (num6 < this.m_DelPVstate.lv.totalRows))
                {
                    if ((offset + m_RowHeight) >= 0f)
                    {
                        if (num4 == -1)
                        {
                            this.m_DelPVstate.IndexToFolderAndFile(num6, ref num4, ref file);
                        }
                        position = new Rect(0f, offset, (float) Screen.width, m_RowHeight);
                        ParentViewFolder folder = this.m_DelPVstate.folders[num4];
                        if ((current.type == EventType.MouseDown) && position.Contains(current.mousePosition))
                        {
                            if (!(((current.button == 1) && (this.SelType == SelectionType.DeletedItems)) && this.m_DelPVstate.selectedItems[index]))
                            {
                                GUIUtility.keyboardControl = this.m_FileViewControlID;
                                this.SelType = SelectionType.DeletedItems;
                                this.m_DelPVstate.lv.row = index;
                                ListViewShared.MultiSelection(null, row, this.m_DelPVstate.lv.row, ref this.m_DelPVstate.initialSelectedItem, ref this.m_DelPVstate.selectedItems);
                                this.ScrollToDeletedItem(index);
                                parentWin.DoLocalSelectionChange();
                            }
                            if ((current.button == 1) && (this.SelType == SelectionType.DeletedItems))
                            {
                                GUIUtility.hotControl = 0;
                                Rect rect3 = new Rect(current.mousePosition.x, current.mousePosition.y, 1f, 1f);
                                EditorUtility.DisplayCustomMenu(rect3, this.dropDownMenuItems, -1, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null);
                            }
                            Event.current.Use();
                        }
                        if (file != -1)
                        {
                            content.text = folder.files[file].name;
                            content.image = InternalEditorUtility.GetIconForFile(folder.files[file].name);
                            baseIndent = (int) (this.m_BaseIndent + (this.m_Indent * 2f));
                        }
                        else
                        {
                            content.text = folder.name;
                            content.image = textured;
                            baseIndent = (int) (this.m_BaseIndent + this.m_Indent);
                        }
                        s.padding.left = baseIndent;
                        if (Event.current.type == EventType.Repaint)
                        {
                            s.Draw(position, content, false, false, this.m_DelPVstate.selectedItems[index], focused);
                        }
                        this.m_DelPVstate.NextFileFolder(ref num4, ref file);
                        index++;
                    }
                    num6++;
                    offset += m_RowHeight;
                }
            }
        }