CountRemaining() private method

private CountRemaining ( int expanded ) : int
expanded int
return int
        private HierarchyProperty GetLast()
        {
            HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
            int count = property.CountRemaining(this.m_ExpandedArray);

            property.Reset();
            if (property.Skip(count, this.m_ExpandedArray))
            {
                return(property);
            }
            return(null);
        }
        private void InitializeFull()
        {
            if (SceneHierarchyWindow.debug)
            {
                GameObjectTreeViewDataSource.Log("Init full (" + this.m_RowCount + ")");
            }
            HierarchyProperty hierarchyProperty = this.CreateHierarchyProperty();

            this.m_RowCount = hierarchyProperty.CountRemaining(this.m_TreeView.state.expandedIDs.ToArray());
            this.ResizeItemList(this.m_RowCount);
            hierarchyProperty.Reset();
            this.InitializeRows(hierarchyProperty, 0, this.m_RowCount - 1);
        }
Beispiel #3
0
        private void SearchAllAssets(HierarchyProperty property)
        {
            int num = Mathf.Min(property.CountRemaining((int[])null), 3000);

            property.Reset();
            int length = this.m_Results.Length;

            Array.Resize <FilteredHierarchy.FilterResult>(ref this.m_Results, this.m_Results.Length + num);
            for (; property.Next((int[])null) && length < this.m_Results.Length; ++length)
            {
                this.CopyPropertyData(ref this.m_Results[length], property);
            }
        }
        private void ScrollToDeletedItem(int index)
        {
            HierarchyProperty property  = new HierarchyProperty(HierarchyType.Assets);
            float             scrollTop = (this.m_SpaceAtTheTop + (property.CountRemaining(this.m_ExpandedArray) * m_RowHeight)) + 6f;

            if (index == -1)
            {
                this.ScrollTo(scrollTop);
            }
            else
            {
                this.ScrollTo(scrollTop + ((index + 1) * m_RowHeight));
            }
        }
Beispiel #5
0
        private void ScrollToDeletedItem(int index)
        {
            HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
            float             num = this.m_SpaceAtTheTop + (float)hierarchyProperty.CountRemaining(this.m_ExpandedArray) * ASHistoryFileView.m_RowHeight + 6f;

            if (index == -1)
            {
                this.ScrollTo(num);
            }
            else
            {
                this.ScrollTo(num + (float)(index + 1) * ASHistoryFileView.m_RowHeight);
            }
        }
Beispiel #6
0
        private void SearchAllAssets(HierarchyProperty property)
        {
            int num = property.CountRemaining(null);

            num = Mathf.Min(num, 3000);
            property.Reset();
            int num2 = this.m_Results.Length;

            Array.Resize <FilteredHierarchy.FilterResult>(ref this.m_Results, this.m_Results.Length + num);
            while (property.Next(null) && num2 < this.m_Results.Length)
            {
                this.CopyPropertyData(ref this.m_Results[num2], property);
                num2++;
            }
        }
Beispiel #7
0
        void InitializeFull()
        {
            if (SceneHierarchy.s_Debug)
            {
                Log("Init full (" + m_RowCount + ")");
            }

            HierarchyProperty property = CreateHierarchyProperty();

            m_RowCount = property.CountRemaining(m_TreeView.state.expandedIDs.ToArray());
            ResizeItemList(m_RowCount);
            property.Reset();

            InitializeRows(property, 0, m_RowCount - 1);
        }
Beispiel #8
0
        void SearchAllAssets(HierarchyProperty property)
        {
            const int k_MaxAddCount = 3000;
            int       elements      = property.CountRemaining(null);

            elements = Mathf.Min(elements, k_MaxAddCount);
            property.Reset();

            int i = m_Results.Length;

            System.Array.Resize(ref m_Results, m_Results.Length + elements);
            while (property.Next(null) && i < m_Results.Length)
            {
                CopyPropertyData(ref m_Results[i], property);
                i++;
            }
        }
        void SearchAllAssets(SearchFilter.SearchArea area)
        {
            const int k_MaxAddCount = 3000;

            if (m_HierarchyType == HierarchyType.Assets)
            {
                List <FilterResult> list = new List <FilterResult>();
                list.AddRange(m_Results);

                var maxAddCount = k_MaxAddCount;
                m_SearchFilter.searchArea = area;
                var enumerator = AssetDatabase.EnumerateAllAssets(m_SearchFilter);
                while (enumerator.MoveNext() && --maxAddCount >= 0)
                {
                    var result = new FilterResult();
                    CopyPropertyData(ref result, enumerator.Current);
                    list.Add(result);
                }

                m_Results = list.ToArray();
            }
            else if (m_HierarchyType == HierarchyType.GameObjects)
            {
                HierarchyProperty property = new HierarchyProperty(m_HierarchyType, false);
                property.SetSearchFilter(m_SearchFilter);

                if (m_SearchFilter.sceneHandles != null &&
                    m_SearchFilter.sceneHandles.Length > 0)
                {
                    property.SetCustomScenes(m_SearchFilter.sceneHandles);
                }

                int elements = property.CountRemaining(null);
                elements = Mathf.Min(elements, k_MaxAddCount);
                property.Reset();

                int i = m_Results.Length;
                System.Array.Resize(ref m_Results, m_Results.Length + elements);
                while (property.Next(null) && i < m_Results.Length)
                {
                    CopyPropertyData(ref m_Results[i], property);
                    i++;
                }
            }
        }
Beispiel #10
0
        private HierarchyProperty GetLast()
        {
            HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
            int count = hierarchyProperty.CountRemaining(this.m_ExpandedArray);

            hierarchyProperty.Reset();
            HierarchyProperty result;

            if (hierarchyProperty.Skip(count, this.m_ExpandedArray))
            {
                result = hierarchyProperty;
            }
            else
            {
                result = null;
            }
            return(result);
        }
        private void InitializeMinimal()
        {
            int[]             expanded          = this.m_TreeView.state.expandedIDs.ToArray();
            HierarchyProperty hierarchyProperty = this.CreateHierarchyProperty();

            this.m_RowCount = hierarchyProperty.CountRemaining(expanded);
            this.ResizeItemList(this.m_RowCount);
            hierarchyProperty.Reset();
            if (SceneHierarchyWindow.debug)
            {
                GameObjectTreeViewDataSource.Log("Init minimal (" + this.m_RowCount + ")");
            }
            int firstRow;
            int lastRow;

            this.m_TreeView.gui.GetFirstAndLastRowVisible(out firstRow, out lastRow);
            this.InitializeRows(hierarchyProperty, firstRow, lastRow);
            this.m_RowsPartiallyInitialized = true;
        }
        private void InitializeMinimal()
        {
            int num;
            int num2;

            int[]             expanded = base.m_TreeView.state.expandedIDs.ToArray();
            HierarchyProperty property = this.CreateHierarchyProperty();

            this.m_RowCount = property.CountRemaining(expanded);
            this.ResizeItemList(this.m_RowCount);
            property.Reset();
            if (SceneHierarchyWindow.debug)
            {
                Log("Init minimal (" + this.m_RowCount + ")");
            }
            base.m_TreeView.gui.GetFirstAndLastRowVisible(out num, out num2);
            this.InitializeRows(property, num, num2);
            this.m_RowsPartiallyInitialized = true;
        }
Beispiel #13
0
        private void InitializeMinimal()
        {
            int[] expanded = m_TreeView.state.expandedIDs.ToArray();

            HierarchyProperty property = CreateHierarchyProperty();

            m_RowCount = property.CountRemaining(expanded);
            ResizeItemList(m_RowCount);
            property.Reset();

            if (SceneHierarchy.s_Debug)
            {
                Log("Init minimal (" + m_RowCount + ") num scenes " + SceneManager.sceneCount);
            }

            int firstRow, lastRow;

            m_TreeView.gui.GetFirstAndLastRowVisible(out firstRow, out lastRow);

            InitializeRows(property, firstRow, lastRow);

            m_RowsPartiallyInitialized = true;
        }
		private HierarchyProperty GetLast()
		{
			HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
			int count = hierarchyProperty.CountRemaining(this.m_ExpandedArray);
			hierarchyProperty.Reset();
			if (hierarchyProperty.Skip(count, this.m_ExpandedArray))
			{
				return hierarchyProperty;
			}
			return null;
		}
        public void DoGUI(ASHistoryWindow parentWin, Rect theRect, bool focused)
        {
            if (ms_Styles == null)
            {
                ms_Styles = new Styles();
            }
            this.m_ScreenRect = theRect;
            Hashtable hashtable = new Hashtable();

            foreach (UnityEngine.Object obj2 in Selection.objects)
            {
                hashtable.Add(obj2.GetInstanceID(), null);
            }
            this.m_FileViewControlID = GUIUtility.GetControlID(ms_FileViewHash, FocusType.Native);
            this.KeyboardGUI(parentWin);
            focused &= GUIUtility.keyboardControl == this.m_FileViewControlID;
            HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
            int  num2     = property.CountRemaining(this.m_ExpandedArray);
            int  num3     = !this.DeletedItemsToggle ? 0 : this.m_DelPVstate.lv.totalRows;
            Rect viewRect = new Rect(0f, 0f, 1f, (((num2 + 2) + num3) * m_RowHeight) + 16f);

            this.m_ScrollPosition = GUI.BeginScrollView(this.m_ScreenRect, this.m_ScrollPosition, viewRect);
            theRect.width         = (viewRect.height <= this.m_ScreenRect.height) ? theRect.width : (theRect.width - 18f);
            int count = Mathf.RoundToInt((this.m_ScrollPosition.y - 6f) - m_RowHeight) / Mathf.RoundToInt(m_RowHeight);

            if (count > num2)
            {
                count = num2;
            }
            else if (count < 0)
            {
                count = 0;
                this.m_ScrollPosition.y = 0f;
            }
            float      y        = 0f;
            GUIContent content  = new GUIContent();
            Event      current  = Event.current;
            GUIStyle   s        = new GUIStyle(ms_Styles.label);
            Texture2D  textured = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);

            y = (count * m_RowHeight) + 3f;
            float endOffset = this.m_ScreenRect.height + this.m_ScrollPosition.y;
            Rect  position  = new Rect(0f, y, theRect.width, m_RowHeight);

            if ((current.type == EventType.MouseDown) && position.Contains(current.mousePosition))
            {
                this.SelType = SelectionType.All;
                GUIUtility.keyboardControl = this.m_FileViewControlID;
                this.ScrollTo(0f);
                parentWin.DoLocalSelectionChange();
                current.Use();
            }
            content = new GUIContent("Entire Project")
            {
                image = textured
            };
            int baseIndent = (int)this.m_BaseIndent;

            s.padding.left = 3;
            if (Event.current.type == EventType.Repaint)
            {
                s.Draw(position, content, false, false, this.SelType == SelectionType.All, focused);
            }
            y += m_RowHeight + 3f;
            property.Reset();
            property.Skip(count, this.m_ExpandedArray);
            while (property.Next(this.m_ExpandedArray) && (y <= endOffset))
            {
                int instanceID = property.instanceID;
                position = new Rect(0f, y, theRect.width, m_RowHeight);
                if (Event.current.type == EventType.Repaint)
                {
                    content.text   = property.name;
                    content.image  = property.icon;
                    baseIndent     = (int)(this.m_BaseIndent + (this.m_Indent * property.depth));
                    s.padding.left = baseIndent;
                    bool on = hashtable.Contains(instanceID);
                    s.Draw(position, content, false, false, on, focused);
                }
                if (property.hasChildren)
                {
                    bool flag2 = property.IsExpanded(this.m_ExpandedArray);
                    GUI.changed = false;
                    Rect rect3 = new Rect((this.m_BaseIndent + (this.m_Indent * property.depth)) - this.m_FoldoutSize, y, this.m_FoldoutSize, m_RowHeight);
                    flag2 = GUI.Toggle(rect3, flag2, GUIContent.none, ms_Styles.foldout);
                    if (GUI.changed)
                    {
                        if (Event.current.alt)
                        {
                            this.SetExpandedRecurse(instanceID, flag2);
                        }
                        else
                        {
                            this.SetExpanded(instanceID, flag2);
                        }
                    }
                }
                if (((current.type == EventType.MouseDown) && (Event.current.button == 0)) && position.Contains(Event.current.mousePosition))
                {
                    GUIUtility.keyboardControl = this.m_FileViewControlID;
                    if (Event.current.clickCount == 2)
                    {
                        AssetDatabase.OpenAsset(instanceID);
                        GUIUtility.ExitGUI();
                    }
                    else if (position.Contains(current.mousePosition))
                    {
                        this.SelectionClick(property);
                    }
                    current.Use();
                }
                y += m_RowHeight;
            }
            y += 3f;
            this.DoDeletedItemsGUI(parentWin, theRect, s, y, endOffset, focused);
            GUI.EndScrollView();
            switch (current.type)
            {
            case EventType.MouseDown:
                if ((current.button == 0) && this.m_ScreenRect.Contains(current.mousePosition))
                {
                    GUIUtility.hotControl = this.m_FileViewControlID;
                    current.Use();
                }
                break;

            case EventType.MouseUp:
                if (GUIUtility.hotControl == this.m_FileViewControlID)
                {
                    if (this.m_ScreenRect.Contains(current.mousePosition))
                    {
                        Selection.activeObject = null;
                    }
                    GUIUtility.hotControl = 0;
                    current.Use();
                }
                break;
            }
            this.HandleFraming();
        }
Beispiel #16
0
        public void DoGUI(ASHistoryWindow parentWin, Rect theRect, bool focused)
        {
            if (ASHistoryFileView.ms_Styles == null)
            {
                ASHistoryFileView.ms_Styles = new ASHistoryFileView.Styles();
            }
            this.m_ScreenRect = theRect;
            Hashtable hashtable = new Hashtable();

            UnityEngine.Object[] objects = Selection.objects;
            for (int i = 0; i < objects.Length; i++)
            {
                UnityEngine.Object @object = objects[i];
                hashtable.Add(@object.GetInstanceID(), null);
            }
            this.m_FileViewControlID = GUIUtility.GetControlID(ASHistoryFileView.ms_FileViewHash, FocusType.Passive);
            this.KeyboardGUI(parentWin);
            focused &= (GUIUtility.keyboardControl == this.m_FileViewControlID);
            HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
            int  num      = hierarchyProperty.CountRemaining(this.m_ExpandedArray);
            int  num2     = (!this.DeletedItemsToggle) ? 0 : this.m_DelPVstate.lv.totalRows;
            Rect viewRect = new Rect(0f, 0f, 1f, (float)(num + 2 + num2) * ASHistoryFileView.m_RowHeight + 16f);

            this.m_ScrollPosition = GUI.BeginScrollView(this.m_ScreenRect, this.m_ScrollPosition, viewRect);
            theRect.width         = ((viewRect.height <= this.m_ScreenRect.height) ? theRect.width : (theRect.width - 18f));
            int num3 = Mathf.RoundToInt(this.m_ScrollPosition.y - 6f - ASHistoryFileView.m_RowHeight) / Mathf.RoundToInt(ASHistoryFileView.m_RowHeight);

            if (num3 > num)
            {
                num3 = num;
            }
            else if (num3 < 0)
            {
                num3 = 0;
                this.m_ScrollPosition.y = 0f;
            }
            GUIContent gUIContent = new GUIContent();
            Event      current    = Event.current;
            GUIStyle   gUIStyle   = new GUIStyle(ASHistoryFileView.ms_Styles.label);
            Texture2D  image      = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
            float      num4       = (float)num3 * ASHistoryFileView.m_RowHeight + 3f;
            float      num5       = this.m_ScreenRect.height + this.m_ScrollPosition.y;
            Rect       position   = new Rect(0f, num4, theRect.width, ASHistoryFileView.m_RowHeight);

            if (current.type == EventType.MouseDown && position.Contains(current.mousePosition))
            {
                this.SelType = ASHistoryFileView.SelectionType.All;
                GUIUtility.keyboardControl = this.m_FileViewControlID;
                this.ScrollTo(0f);
                parentWin.DoLocalSelectionChange();
                current.Use();
            }
            gUIContent       = new GUIContent("Entire Project");
            gUIContent.image = image;
            int left = (int)this.m_BaseIndent;

            gUIStyle.padding.left = 3;
            if (Event.current.type == EventType.Repaint)
            {
                gUIStyle.Draw(position, gUIContent, false, false, this.SelType == ASHistoryFileView.SelectionType.All, focused);
            }
            num4 += ASHistoryFileView.m_RowHeight + 3f;
            hierarchyProperty.Reset();
            hierarchyProperty.Skip(num3, this.m_ExpandedArray);
            while (hierarchyProperty.Next(this.m_ExpandedArray) && num4 <= num5)
            {
                int instanceID = hierarchyProperty.instanceID;
                position = new Rect(0f, num4, theRect.width, ASHistoryFileView.m_RowHeight);
                if (Event.current.type == EventType.Repaint)
                {
                    gUIContent.text       = hierarchyProperty.name;
                    gUIContent.image      = hierarchyProperty.icon;
                    left                  = (int)(this.m_BaseIndent + this.m_Indent * (float)hierarchyProperty.depth);
                    gUIStyle.padding.left = left;
                    bool on = hashtable.Contains(instanceID);
                    gUIStyle.Draw(position, gUIContent, false, false, on, focused);
                }
                if (hierarchyProperty.hasChildren)
                {
                    bool flag = hierarchyProperty.IsExpanded(this.m_ExpandedArray);
                    GUI.changed = false;
                    Rect position2 = new Rect(this.m_BaseIndent + this.m_Indent * (float)hierarchyProperty.depth - this.m_FoldoutSize, num4, this.m_FoldoutSize, ASHistoryFileView.m_RowHeight);
                    flag = GUI.Toggle(position2, flag, GUIContent.none, ASHistoryFileView.ms_Styles.foldout);
                    if (GUI.changed)
                    {
                        if (Event.current.alt)
                        {
                            this.SetExpandedRecurse(instanceID, flag);
                        }
                        else
                        {
                            this.SetExpanded(instanceID, flag);
                        }
                    }
                }
                if (current.type == EventType.MouseDown && Event.current.button == 0 && position.Contains(Event.current.mousePosition))
                {
                    GUIUtility.keyboardControl = this.m_FileViewControlID;
                    if (Event.current.clickCount == 2)
                    {
                        AssetDatabase.OpenAsset(instanceID);
                        GUIUtility.ExitGUI();
                    }
                    else if (position.Contains(current.mousePosition))
                    {
                        this.SelectionClick(hierarchyProperty);
                    }
                    current.Use();
                }
                num4 += ASHistoryFileView.m_RowHeight;
            }
            num4 += 3f;
            this.DoDeletedItemsGUI(parentWin, theRect, gUIStyle, num4, num5, focused);
            GUI.EndScrollView();
            EventType type = current.type;

            if (type != EventType.MouseDown)
            {
                if (type == EventType.MouseUp)
                {
                    if (GUIUtility.hotControl == this.m_FileViewControlID)
                    {
                        if (this.m_ScreenRect.Contains(current.mousePosition))
                        {
                            Selection.activeObject = null;
                        }
                        GUIUtility.hotControl = 0;
                        current.Use();
                    }
                }
            }
            else if (current.button == 0 && this.m_ScreenRect.Contains(current.mousePosition))
            {
                GUIUtility.hotControl = this.m_FileViewControlID;
                current.Use();
            }
            this.HandleFraming();
        }
		private void SearchAllAssets(HierarchyProperty property)
		{
			int num = property.CountRemaining(null);
			num = Mathf.Min(num, 3000);
			property.Reset();
			int num2 = this.m_Results.Length;
			Array.Resize<FilteredHierarchy.FilterResult>(ref this.m_Results, this.m_Results.Length + num);
			while (property.Next(null) && num2 < this.m_Results.Length)
			{
				this.CopyPropertyData(ref this.m_Results[num2], property);
				num2++;
			}
		}
        public void DoGUI(ASHistoryWindow parentWin, Rect theRect, bool focused)
        {
            if (ms_Styles == null)
            {
                ms_Styles = new Styles();
            }
            this.m_ScreenRect = theRect;
            Hashtable hashtable = new Hashtable();
            foreach (UnityEngine.Object obj2 in Selection.objects)
            {
                hashtable.Add(obj2.GetInstanceID(), null);
            }
            this.m_FileViewControlID = GUIUtility.GetControlID(ms_FileViewHash, FocusType.Native);
            this.KeyboardGUI(parentWin);
            focused &= GUIUtility.keyboardControl == this.m_FileViewControlID;
            HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
            int num2 = property.CountRemaining(this.m_ExpandedArray);
            int num3 = !this.DeletedItemsToggle ? 0 : this.m_DelPVstate.lv.totalRows;
            Rect viewRect = new Rect(0f, 0f, 1f, (((num2 + 2) + num3) * m_RowHeight) + 16f);
            this.m_ScrollPosition = GUI.BeginScrollView(this.m_ScreenRect, this.m_ScrollPosition, viewRect);
            theRect.width = (viewRect.height <= this.m_ScreenRect.height) ? theRect.width : (theRect.width - 18f);
            int count = Mathf.RoundToInt((this.m_ScrollPosition.y - 6f) - m_RowHeight) / Mathf.RoundToInt(m_RowHeight);
            if (count > num2)
            {
                count = num2;
            }
            else if (count < 0)
            {
                count = 0;
                this.m_ScrollPosition.y = 0f;
            }
            float y = 0f;
            GUIContent content = new GUIContent();
            Event current = Event.current;
            GUIStyle s = new GUIStyle(ms_Styles.label);
            Texture2D textured = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
            y = (count * m_RowHeight) + 3f;
            float endOffset = this.m_ScreenRect.height + this.m_ScrollPosition.y;
            Rect position = new Rect(0f, y, theRect.width, m_RowHeight);
            if ((current.type == EventType.MouseDown) && position.Contains(current.mousePosition))
            {
                this.SelType = SelectionType.All;
                GUIUtility.keyboardControl = this.m_FileViewControlID;
                this.ScrollTo(0f);
                parentWin.DoLocalSelectionChange();
                current.Use();
            }
            content = new GUIContent("Entire Project") {
                image = textured
            };
            int baseIndent = (int) this.m_BaseIndent;
            s.padding.left = 3;
            if (Event.current.type == EventType.Repaint)
            {
                s.Draw(position, content, false, false, this.SelType == SelectionType.All, focused);
            }
            y += m_RowHeight + 3f;
            property.Reset();
            property.Skip(count, this.m_ExpandedArray);
            while (property.Next(this.m_ExpandedArray) && (y <= endOffset))
            {
                int instanceID = property.instanceID;
                position = new Rect(0f, y, theRect.width, m_RowHeight);
                if (Event.current.type == EventType.Repaint)
                {
                    content.text = property.name;
                    content.image = property.icon;
                    baseIndent = (int) (this.m_BaseIndent + (this.m_Indent * property.depth));
                    s.padding.left = baseIndent;
                    bool on = hashtable.Contains(instanceID);
                    s.Draw(position, content, false, false, on, focused);
                }
                if (property.hasChildren)
                {
                    bool flag2 = property.IsExpanded(this.m_ExpandedArray);
                    GUI.changed = false;
                    Rect rect3 = new Rect((this.m_BaseIndent + (this.m_Indent * property.depth)) - this.m_FoldoutSize, y, this.m_FoldoutSize, m_RowHeight);
                    flag2 = GUI.Toggle(rect3, flag2, GUIContent.none, ms_Styles.foldout);
                    if (GUI.changed)
                    {
                        if (Event.current.alt)
                        {
                            this.SetExpandedRecurse(instanceID, flag2);
                        }
                        else
                        {
                            this.SetExpanded(instanceID, flag2);
                        }
                    }
                }
                if (((current.type == EventType.MouseDown) && (Event.current.button == 0)) && position.Contains(Event.current.mousePosition))
                {
                    GUIUtility.keyboardControl = this.m_FileViewControlID;
                    if (Event.current.clickCount == 2)
                    {
                        AssetDatabase.OpenAsset(instanceID);
                        GUIUtility.ExitGUI();
                    }
                    else if (position.Contains(current.mousePosition))
                    {
                        this.SelectionClick(property);
                    }
                    current.Use();
                }
                y += m_RowHeight;
            }
            y += 3f;
            this.DoDeletedItemsGUI(parentWin, theRect, s, y, endOffset, focused);
            GUI.EndScrollView();
            switch (current.type)
            {
                case EventType.MouseDown:
                    if ((current.button == 0) && this.m_ScreenRect.Contains(current.mousePosition))
                    {
                        GUIUtility.hotControl = this.m_FileViewControlID;
                        current.Use();
                    }
                    break;

                case EventType.MouseUp:
                    if (GUIUtility.hotControl == this.m_FileViewControlID)
                    {
                        if (this.m_ScreenRect.Contains(current.mousePosition))
                        {
                            Selection.activeObject = null;
                        }
                        GUIUtility.hotControl = 0;
                        current.Use();
                    }
                    break;
            }
            this.HandleFraming();
        }
        public void DoGUI(ASHistoryWindow parentWin, Rect theRect, bool focused)
        {
            if (ASHistoryFileView.ms_Styles == null)
            {
                ASHistoryFileView.ms_Styles = new ASHistoryFileView.Styles();
            }
            this.m_ScreenRect = theRect;
            Hashtable hashtable = new Hashtable();

            foreach (UnityEngine.Object @object in Selection.objects)
            {
                hashtable.Add((object)@object.GetInstanceID(), (object)null);
            }
            this.m_FileViewControlID = GUIUtility.GetControlID(ASHistoryFileView.ms_FileViewHash, FocusType.Native);
            this.KeyboardGUI(parentWin);
            focused &= GUIUtility.keyboardControl == this.m_FileViewControlID;
            HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
            int  num1     = property.CountRemaining(this.m_ExpandedArray);
            int  num2     = !this.DeletedItemsToggle ? 0 : this.m_DelPVstate.lv.totalRows;
            Rect viewRect = new Rect(0.0f, 0.0f, 1f, (float)((double)(num1 + 2 + num2) * (double)ASHistoryFileView.m_RowHeight + 16.0));

            this.m_ScrollPosition = GUI.BeginScrollView(this.m_ScreenRect, this.m_ScrollPosition, viewRect);
            theRect.width         = (double)viewRect.height <= (double)this.m_ScreenRect.height ? theRect.width : theRect.width - 18f;
            int count = Mathf.RoundToInt(this.m_ScrollPosition.y - 6f - ASHistoryFileView.m_RowHeight) / Mathf.RoundToInt(ASHistoryFileView.m_RowHeight);

            if (count > num1)
            {
                count = num1;
            }
            else if (count < 0)
            {
                count = 0;
                this.m_ScrollPosition.y = 0.0f;
            }
            GUIContent guiContent = new GUIContent();
            Event      current    = Event.current;
            GUIStyle   s          = new GUIStyle(ASHistoryFileView.ms_Styles.label);
            Texture2D  texture    = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
            float      y1         = (float)((double)count * (double)ASHistoryFileView.m_RowHeight + 3.0);
            float      endOffset  = this.m_ScreenRect.height + this.m_ScrollPosition.y;
            Rect       position   = new Rect(0.0f, y1, theRect.width, ASHistoryFileView.m_RowHeight);

            if (current.type == EventType.MouseDown && position.Contains(current.mousePosition))
            {
                this.SelType = ASHistoryFileView.SelectionType.All;
                GUIUtility.keyboardControl = this.m_FileViewControlID;
                this.ScrollTo(0.0f);
                parentWin.DoLocalSelectionChange();
                current.Use();
            }
            GUIContent content = new GUIContent("Entire Project");

            content.image = (Texture)texture;
            int baseIndent = (int)this.m_BaseIndent;

            s.padding.left = 3;
            if (Event.current.type == EventType.Repaint)
            {
                s.Draw(position, content, false, false, this.SelType == ASHistoryFileView.SelectionType.All, focused);
            }
            float y2 = y1 + (ASHistoryFileView.m_RowHeight + 3f);

            property.Reset();
            property.Skip(count, this.m_ExpandedArray);
            while (property.Next(this.m_ExpandedArray) && (double)y2 <= (double)endOffset)
            {
                int instanceId = property.instanceID;
                position = new Rect(0.0f, y2, theRect.width, ASHistoryFileView.m_RowHeight);
                if (Event.current.type == EventType.Repaint)
                {
                    content.text  = property.name;
                    content.image = (Texture)property.icon;
                    int num3 = (int)((double)this.m_BaseIndent + (double)this.m_Indent * (double)property.depth);
                    s.padding.left = num3;
                    bool on = hashtable.Contains((object)instanceId);
                    s.Draw(position, content, false, false, on, focused);
                }
                if (property.hasChildren)
                {
                    bool flag = property.IsExpanded(this.m_ExpandedArray);
                    GUI.changed = false;
                    bool expand = GUI.Toggle(new Rect(this.m_BaseIndent + this.m_Indent * (float)property.depth - this.m_FoldoutSize, y2, this.m_FoldoutSize, ASHistoryFileView.m_RowHeight), flag, GUIContent.none, ASHistoryFileView.ms_Styles.foldout);
                    if (GUI.changed)
                    {
                        if (Event.current.alt)
                        {
                            this.SetExpandedRecurse(instanceId, expand);
                        }
                        else
                        {
                            this.SetExpanded(instanceId, expand);
                        }
                    }
                }
                if (current.type == EventType.MouseDown && Event.current.button == 0 && position.Contains(Event.current.mousePosition))
                {
                    GUIUtility.keyboardControl = this.m_FileViewControlID;
                    if (Event.current.clickCount == 2)
                    {
                        AssetDatabase.OpenAsset(instanceId);
                        GUIUtility.ExitGUI();
                    }
                    else if (position.Contains(current.mousePosition))
                    {
                        this.SelectionClick(property);
                    }
                    current.Use();
                }
                y2 += ASHistoryFileView.m_RowHeight;
            }
            float offset = y2 + 3f;

            this.DoDeletedItemsGUI(parentWin, theRect, s, offset, endOffset, focused);
            GUI.EndScrollView();
            switch (current.type)
            {
            case EventType.MouseDown:
                if (current.button == 0 && this.m_ScreenRect.Contains(current.mousePosition))
                {
                    GUIUtility.hotControl = this.m_FileViewControlID;
                    current.Use();
                    break;
                }
                break;

            case EventType.MouseUp:
                if (GUIUtility.hotControl == this.m_FileViewControlID)
                {
                    if (this.m_ScreenRect.Contains(current.mousePosition))
                    {
                        Selection.activeObject = (UnityEngine.Object)null;
                    }
                    GUIUtility.hotControl = 0;
                    current.Use();
                    break;
                }
                break;
            }
            this.HandleFraming();
        }
		public void DoGUI(ASHistoryWindow parentWin, Rect theRect, bool focused)
		{
			if (ASHistoryFileView.ms_Styles == null)
			{
				ASHistoryFileView.ms_Styles = new ASHistoryFileView.Styles();
			}
			this.m_ScreenRect = theRect;
			Hashtable hashtable = new Hashtable();
			UnityEngine.Object[] objects = Selection.objects;
			for (int i = 0; i < objects.Length; i++)
			{
				UnityEngine.Object @object = objects[i];
				hashtable.Add(@object.GetInstanceID(), null);
			}
			this.m_FileViewControlID = GUIUtility.GetControlID(ASHistoryFileView.ms_FileViewHash, FocusType.Native);
			this.KeyboardGUI(parentWin);
			focused &= (GUIUtility.keyboardControl == this.m_FileViewControlID);
			HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
			int num = hierarchyProperty.CountRemaining(this.m_ExpandedArray);
			int num2 = (!this.DeletedItemsToggle) ? 0 : this.m_DelPVstate.lv.totalRows;
			Rect viewRect = new Rect(0f, 0f, 1f, (float)(num + 2 + num2) * ASHistoryFileView.m_RowHeight + 16f);
			this.m_ScrollPosition = GUI.BeginScrollView(this.m_ScreenRect, this.m_ScrollPosition, viewRect);
			theRect.width = ((viewRect.height <= this.m_ScreenRect.height) ? theRect.width : (theRect.width - 18f));
			int num3 = Mathf.RoundToInt(this.m_ScrollPosition.y - 6f - ASHistoryFileView.m_RowHeight) / Mathf.RoundToInt(ASHistoryFileView.m_RowHeight);
			if (num3 > num)
			{
				num3 = num;
			}
			else
			{
				if (num3 < 0)
				{
					num3 = 0;
					this.m_ScrollPosition.y = 0f;
				}
			}
			GUIContent gUIContent = new GUIContent();
			Event current = Event.current;
			GUIStyle gUIStyle = new GUIStyle(ASHistoryFileView.ms_Styles.label);
			Texture2D image = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
			float num4 = (float)num3 * ASHistoryFileView.m_RowHeight + 3f;
			float num5 = this.m_ScreenRect.height + this.m_ScrollPosition.y;
			Rect position = new Rect(0f, num4, theRect.width, ASHistoryFileView.m_RowHeight);
			if (current.type == EventType.MouseDown && position.Contains(current.mousePosition))
			{
				this.SelType = ASHistoryFileView.SelectionType.All;
				GUIUtility.keyboardControl = this.m_FileViewControlID;
				this.ScrollTo(0f);
				parentWin.DoLocalSelectionChange();
				current.Use();
			}
			gUIContent = new GUIContent("Entire Project");
			gUIContent.image = image;
			int left = (int)this.m_BaseIndent;
			gUIStyle.padding.left = 3;
			if (Event.current.type == EventType.Repaint)
			{
				gUIStyle.Draw(position, gUIContent, false, false, this.SelType == ASHistoryFileView.SelectionType.All, focused);
			}
			num4 += ASHistoryFileView.m_RowHeight + 3f;
			hierarchyProperty.Reset();
			hierarchyProperty.Skip(num3, this.m_ExpandedArray);
			while (hierarchyProperty.Next(this.m_ExpandedArray) && num4 <= num5)
			{
				int instanceID = hierarchyProperty.instanceID;
				position = new Rect(0f, num4, theRect.width, ASHistoryFileView.m_RowHeight);
				if (Event.current.type == EventType.Repaint)
				{
					gUIContent.text = hierarchyProperty.name;
					gUIContent.image = hierarchyProperty.icon;
					left = (int)(this.m_BaseIndent + this.m_Indent * (float)hierarchyProperty.depth);
					gUIStyle.padding.left = left;
					bool on = hashtable.Contains(instanceID);
					gUIStyle.Draw(position, gUIContent, false, false, on, focused);
				}
				if (hierarchyProperty.hasChildren)
				{
					bool flag = hierarchyProperty.IsExpanded(this.m_ExpandedArray);
					GUI.changed = false;
					Rect position2 = new Rect(this.m_BaseIndent + this.m_Indent * (float)hierarchyProperty.depth - this.m_FoldoutSize, num4, this.m_FoldoutSize, ASHistoryFileView.m_RowHeight);
					flag = GUI.Toggle(position2, flag, GUIContent.none, ASHistoryFileView.ms_Styles.foldout);
					if (GUI.changed)
					{
						if (Event.current.alt)
						{
							this.SetExpandedRecurse(instanceID, flag);
						}
						else
						{
							this.SetExpanded(instanceID, flag);
						}
					}
				}
				if (current.type == EventType.MouseDown && Event.current.button == 0 && position.Contains(Event.current.mousePosition))
				{
					GUIUtility.keyboardControl = this.m_FileViewControlID;
					if (Event.current.clickCount == 2)
					{
						AssetDatabase.OpenAsset(instanceID);
						GUIUtility.ExitGUI();
					}
					else
					{
						if (position.Contains(current.mousePosition))
						{
							this.SelectionClick(hierarchyProperty);
						}
					}
					current.Use();
				}
				num4 += ASHistoryFileView.m_RowHeight;
			}
			num4 += 3f;
			this.DoDeletedItemsGUI(parentWin, theRect, gUIStyle, num4, num5, focused);
			GUI.EndScrollView();
			EventType type = current.type;
			if (type != EventType.MouseDown)
			{
				if (type == EventType.MouseUp)
				{
					if (GUIUtility.hotControl == this.m_FileViewControlID)
					{
						if (this.m_ScreenRect.Contains(current.mousePosition))
						{
							Selection.activeObject = null;
						}
						GUIUtility.hotControl = 0;
						current.Use();
					}
				}
			}
			else
			{
				if (current.button == 0 && this.m_ScreenRect.Contains(current.mousePosition))
				{
					GUIUtility.hotControl = this.m_FileViewControlID;
					current.Use();
				}
			}
			this.HandleFraming();
		}
 private void SearchAllAssets(HierarchyProperty property)
 {
   int num = Mathf.Min(property.CountRemaining((int[]) null), 3000);
   property.Reset();
   int length = this.m_Results.Length;
   Array.Resize<FilteredHierarchy.FilterResult>(ref this.m_Results, this.m_Results.Length + num);
   for (; property.Next((int[]) null) && length < this.m_Results.Length; ++length)
     this.CopyPropertyData(ref this.m_Results[length], property);
 }
 private void ScrollToDeletedItem(int index)
 {
     HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
     float scrollTop = (this.m_SpaceAtTheTop + (property.CountRemaining(this.m_ExpandedArray) * m_RowHeight)) + 6f;
     if (index == -1)
     {
         this.ScrollTo(scrollTop);
     }
     else
     {
         this.ScrollTo(scrollTop + ((index + 1) * m_RowHeight));
     }
 }
		private void ScrollToDeletedItem(int index)
		{
			HierarchyProperty hierarchyProperty = new HierarchyProperty(HierarchyType.Assets);
			float num = this.m_SpaceAtTheTop + (float)hierarchyProperty.CountRemaining(this.m_ExpandedArray) * ASHistoryFileView.m_RowHeight + 6f;
			if (index == -1)
			{
				this.ScrollTo(num);
			}
			else
			{
				this.ScrollTo(num + (float)(index + 1) * ASHistoryFileView.m_RowHeight);
			}
		}
 public void DoGUI(ASHistoryWindow parentWin, Rect theRect, bool focused)
 {
   if (ASHistoryFileView.ms_Styles == null)
     ASHistoryFileView.ms_Styles = new ASHistoryFileView.Styles();
   this.m_ScreenRect = theRect;
   Hashtable hashtable = new Hashtable();
   foreach (UnityEngine.Object @object in Selection.objects)
     hashtable.Add((object) @object.GetInstanceID(), (object) null);
   this.m_FileViewControlID = GUIUtility.GetControlID(ASHistoryFileView.ms_FileViewHash, FocusType.Native);
   this.KeyboardGUI(parentWin);
   focused &= GUIUtility.keyboardControl == this.m_FileViewControlID;
   HierarchyProperty property = new HierarchyProperty(HierarchyType.Assets);
   int num1 = property.CountRemaining(this.m_ExpandedArray);
   int num2 = !this.DeletedItemsToggle ? 0 : this.m_DelPVstate.lv.totalRows;
   Rect viewRect = new Rect(0.0f, 0.0f, 1f, (float) ((double) (num1 + 2 + num2) * (double) ASHistoryFileView.m_RowHeight + 16.0));
   this.m_ScrollPosition = GUI.BeginScrollView(this.m_ScreenRect, this.m_ScrollPosition, viewRect);
   theRect.width = (double) viewRect.height <= (double) this.m_ScreenRect.height ? theRect.width : theRect.width - 18f;
   int count = Mathf.RoundToInt(this.m_ScrollPosition.y - 6f - ASHistoryFileView.m_RowHeight) / Mathf.RoundToInt(ASHistoryFileView.m_RowHeight);
   if (count > num1)
     count = num1;
   else if (count < 0)
   {
     count = 0;
     this.m_ScrollPosition.y = 0.0f;
   }
   GUIContent guiContent = new GUIContent();
   Event current = Event.current;
   GUIStyle s = new GUIStyle(ASHistoryFileView.ms_Styles.label);
   Texture2D texture = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
   float y1 = (float) ((double) count * (double) ASHistoryFileView.m_RowHeight + 3.0);
   float endOffset = this.m_ScreenRect.height + this.m_ScrollPosition.y;
   Rect position = new Rect(0.0f, y1, theRect.width, ASHistoryFileView.m_RowHeight);
   if (current.type == EventType.MouseDown && position.Contains(current.mousePosition))
   {
     this.SelType = ASHistoryFileView.SelectionType.All;
     GUIUtility.keyboardControl = this.m_FileViewControlID;
     this.ScrollTo(0.0f);
     parentWin.DoLocalSelectionChange();
     current.Use();
   }
   GUIContent content = new GUIContent("Entire Project");
   content.image = (Texture) texture;
   int baseIndent = (int) this.m_BaseIndent;
   s.padding.left = 3;
   if (Event.current.type == EventType.Repaint)
     s.Draw(position, content, false, false, this.SelType == ASHistoryFileView.SelectionType.All, focused);
   float y2 = y1 + (ASHistoryFileView.m_RowHeight + 3f);
   property.Reset();
   property.Skip(count, this.m_ExpandedArray);
   while (property.Next(this.m_ExpandedArray) && (double) y2 <= (double) endOffset)
   {
     int instanceId = property.instanceID;
     position = new Rect(0.0f, y2, theRect.width, ASHistoryFileView.m_RowHeight);
     if (Event.current.type == EventType.Repaint)
     {
       content.text = property.name;
       content.image = (Texture) property.icon;
       int num3 = (int) ((double) this.m_BaseIndent + (double) this.m_Indent * (double) property.depth);
       s.padding.left = num3;
       bool on = hashtable.Contains((object) instanceId);
       s.Draw(position, content, false, false, on, focused);
     }
     if (property.hasChildren)
     {
       bool flag = property.IsExpanded(this.m_ExpandedArray);
       GUI.changed = false;
       bool expand = GUI.Toggle(new Rect(this.m_BaseIndent + this.m_Indent * (float) property.depth - this.m_FoldoutSize, y2, this.m_FoldoutSize, ASHistoryFileView.m_RowHeight), flag, GUIContent.none, ASHistoryFileView.ms_Styles.foldout);
       if (GUI.changed)
       {
         if (Event.current.alt)
           this.SetExpandedRecurse(instanceId, expand);
         else
           this.SetExpanded(instanceId, expand);
       }
     }
     if (current.type == EventType.MouseDown && Event.current.button == 0 && position.Contains(Event.current.mousePosition))
     {
       GUIUtility.keyboardControl = this.m_FileViewControlID;
       if (Event.current.clickCount == 2)
       {
         AssetDatabase.OpenAsset(instanceId);
         GUIUtility.ExitGUI();
       }
       else if (position.Contains(current.mousePosition))
         this.SelectionClick(property);
       current.Use();
     }
     y2 += ASHistoryFileView.m_RowHeight;
   }
   float offset = y2 + 3f;
   this.DoDeletedItemsGUI(parentWin, theRect, s, offset, endOffset, focused);
   GUI.EndScrollView();
   switch (current.type)
   {
     case EventType.MouseDown:
       if (current.button == 0 && this.m_ScreenRect.Contains(current.mousePosition))
       {
         GUIUtility.hotControl = this.m_FileViewControlID;
         current.Use();
         break;
       }
       break;
     case EventType.MouseUp:
       if (GUIUtility.hotControl == this.m_FileViewControlID)
       {
         if (this.m_ScreenRect.Contains(current.mousePosition))
           Selection.activeObject = (UnityEngine.Object) null;
         GUIUtility.hotControl = 0;
         current.Use();
         break;
       }
       break;
   }
   this.HandleFraming();
 }