상속: TreeViewItem
예제 #1
0
        protected override Texture GetIconForItem(TreeViewItem item)
        {
            Texture result;

            if (item != null && item.icon != null)
            {
                result = item.icon;
            }
            else
            {
                SearchFilterTreeItem searchFilterTreeItem = item as SearchFilterTreeItem;
                if (searchFilterTreeItem != null)
                {
                    if (this.IsVisibleRootNode(item))
                    {
                        result = this.k_FavoritesIcon;
                    }
                    else if (searchFilterTreeItem.isFolder)
                    {
                        result = this.k_FavoriteFolderIcon;
                    }
                    else
                    {
                        result = this.k_FavoriteFilterIcon;
                    }
                }
                else
                {
                    result = base.GetIconForItem(item);
                }
            }
            return(result);
        }
예제 #2
0
        private TreeViewItem BuildTreeView()
        {
            this.Init();
            if (this.m_SavedFilters.Count == 0)
            {
                Debug.LogError("BuildTreeView: No saved filters! We should at least have a root");
                return(null);
            }
            TreeViewItem        root         = null;
            List <TreeViewItem> visibleItems = new List <TreeViewItem>();

            for (int i = 0; i < this.m_SavedFilters.Count; i++)
            {
                SavedFilter  filter   = this.m_SavedFilters[i];
                int          iD       = filter.m_ID;
                int          depth    = filter.m_Depth;
                bool         isFolder = filter.m_Filter.GetState() == SearchFilter.State.FolderBrowsing;
                TreeViewItem item     = new SearchFilterTreeItem(iD, depth, null, filter.m_Name, isFolder);
                if (i == 0)
                {
                    root = item;
                }
                else
                {
                    visibleItems.Add(item);
                }
            }
            TreeViewUtility.SetChildParentReferences(visibleItems, root);
            return(root);
        }
예제 #3
0
        protected override Texture GetIconForItem(TreeViewItem item)
        {
            if (item != null && item.icon != null)
            {
                return(item.icon);
            }

            SearchFilterTreeItem searchFilterItem = item as SearchFilterTreeItem;

            if (searchFilterItem != null)
            {
                if (IsVisibleRootNode(item))
                {
                    return(k_FavoritesIcon);
                }
                if (searchFilterItem.isFolder)
                {
                    return(k_FavoriteFolderIcon);
                }
                else
                {
                    return(k_FavoriteFilterIcon);
                }
            }
            return(base.GetIconForItem(item));
        }
        private TreeViewItem BuildTreeView()
        {
            this.Init();
            TreeViewItem result;

            if (this.m_SavedFilters.Count == 0)
            {
                Debug.LogError("BuildTreeView: No saved filters! We should at least have a root");
                result = null;
            }
            else
            {
                TreeViewItem        treeViewItem = null;
                List <TreeViewItem> list         = new List <TreeViewItem>();
                for (int i = 0; i < this.m_SavedFilters.Count; i++)
                {
                    SavedFilter  savedFilter   = this.m_SavedFilters[i];
                    int          iD            = savedFilter.m_ID;
                    int          depth         = savedFilter.m_Depth;
                    bool         isFolder      = savedFilter.m_Filter.GetState() == SearchFilter.State.FolderBrowsing;
                    TreeViewItem treeViewItem2 = new SearchFilterTreeItem(iD, depth, null, savedFilter.m_Name, isFolder);
                    if (i == 0)
                    {
                        treeViewItem = treeViewItem2;
                    }
                    else
                    {
                        list.Add(treeViewItem2);
                    }
                }
                TreeViewUtility.SetChildParentReferences(list, treeViewItem);
                result = treeViewItem;
            }
            return(result);
        }
        protected override Texture GetIconForItem(TreeViewItem item)
        {
            if (item != null && item.icon != null)
            {
                var icon = item.icon;
                AssetsTreeViewDataSource.FolderTreeItemBase folderItem = item as AssetsTreeViewDataSource.FolderTreeItemBase;

                if (folderItem != null && m_TreeView.data.IsExpanded(folderItem))
                {
                    icon = openFolderTexture;
                }

                return(icon);
            }

            SearchFilterTreeItem searchFilterItem = item as SearchFilterTreeItem;

            if (searchFilterItem != null)
            {
                if (IsVisibleRootNode(item))
                {
                    return(k_FavoritesIcon);
                }
                if (searchFilterItem.isFolder)
                {
                    return(k_FavoriteFolderIcon);
                }
                else
                {
                    return(k_FavoriteFilterIcon);
                }
            }
            return(base.GetIconForItem(item));
        }
예제 #6
0
        // Utility function for building a tree view from saved filter state. Returns root of tree
        TreeViewItem BuildTreeView()
        {
            Init();

            if (m_SavedFilters.Count == 0)
            {
                Debug.LogError("BuildTreeView: No saved filters! We should at least have a root");
                return(null);
            }

            TreeViewItem root = null;

            // Create rest of nodes
            List <TreeViewItem> items = new List <TreeViewItem>();

            for (int i = 0; i < m_SavedFilters.Count; ++i)
            {
                SavedFilter  savedFilter = m_SavedFilters[i];
                int          instanceID  = savedFilter.m_ID;
                int          depth       = savedFilter.m_Depth;
                bool         isFolder    = savedFilter.m_Filter.GetState() == SearchFilter.State.FolderBrowsing;
                TreeViewItem item        = new SearchFilterTreeItem(instanceID, depth, null, savedFilter.m_Name, isFolder);
                if (i == 0)
                {
                    root = item;
                }
                else
                {
                    if (Collab.instance.collabFilters.ContainsSearchFilter(savedFilter.m_Name, savedFilter.m_Filter.FilterToSearchFieldString()))
                    {
                        if (!Collab.instance.IsCollabEnabledForCurrentProject())
                        {
                            continue;
                        }
                    }

                    if (SoftlockViewController.Instance.softLockFilters.ContainsSearchFilter(savedFilter.m_Name, savedFilter.m_Filter.FilterToSearchFieldString()))
                    {
                        if (CollabSettingsManager.IsAvailable(CollabSettingType.InProgressEnabled))
                        {
                            if (!Collab.instance.IsCollabEnabledForCurrentProject() || !CollabSettingsManager.inProgressEnabled)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    items.Add(item);
                }
            }

            // Fix child/parent references
            TreeViewUtility.SetChildParentReferences(items, root);

            return(root);
        }
예제 #7
0
        private TreeViewItem BuildTreeView()
        {
            this.Init();
            TreeViewItem result;

            if (this.m_SavedFilters.Count == 0)
            {
                Debug.LogError("BuildTreeView: No saved filters! We should at least have a root");
                result = null;
            }
            else
            {
                TreeViewItem        treeViewItem = null;
                List <TreeViewItem> list         = new List <TreeViewItem>();
                int i = 0;
                while (i < this.m_SavedFilters.Count)
                {
                    SavedFilter  savedFilter   = this.m_SavedFilters[i];
                    int          iD            = savedFilter.m_ID;
                    int          depth         = savedFilter.m_Depth;
                    bool         isFolder      = savedFilter.m_Filter.GetState() == SearchFilter.State.FolderBrowsing;
                    TreeViewItem treeViewItem2 = new SearchFilterTreeItem(iD, depth, null, savedFilter.m_Name, isFolder);
                    if (i == 0)
                    {
                        treeViewItem = treeViewItem2;
                    }
                    else
                    {
                        if (Collab.instance.collabFilters.ContainsSearchFilter(savedFilter.m_Name, savedFilter.m_Filter.FilterToSearchFieldString()))
                        {
                            if (!Collab.instance.IsCollabEnabledForCurrentProject())
                            {
                                goto IL_133;
                            }
                        }
                        if (SoftlockViewController.Instance.softLockFilters.ContainsSearchFilter(savedFilter.m_Name, savedFilter.m_Filter.FilterToSearchFieldString()))
                        {
                            if (!CollabSettingsManager.IsAvailable(CollabSettingType.InProgressEnabled))
                            {
                                goto IL_133;
                            }
                            if (!Collab.instance.IsCollabEnabledForCurrentProject() || !CollabSettingsManager.inProgressEnabled)
                            {
                                goto IL_133;
                            }
                        }
                        list.Add(treeViewItem2);
                    }
IL_133:
                    i++;
                    continue;
                    goto IL_133;
                }
                TreeViewUtility.SetChildParentReferences(list, treeViewItem);
                result = treeViewItem;
            }
            return(result);
        }
예제 #8
0
        protected override Texture GetIconForNode(TreeViewItem item)
        {
            if ((item != null) && (item.icon != null))
            {
                return(item.icon);
            }
            SearchFilterTreeItem item2 = item as SearchFilterTreeItem;

            if (item2 == null)
            {
                return(base.GetIconForNode(item));
            }
            if (this.IsVisibleRootNode(item))
            {
                return(this.k_FavoritesIcon);
            }
            if (item2.isFolder)
            {
                return(this.k_FavoriteFolderIcon);
            }
            return(this.k_FavoriteFilterIcon);
        }
예제 #9
0
        protected override Texture GetIconForNode(TreeViewItem item)
        {
            if (item != null && (Object)item.icon != (Object)null)
            {
                return((Texture)item.icon);
            }
            SearchFilterTreeItem searchFilterTreeItem = item as SearchFilterTreeItem;

            if (searchFilterTreeItem == null)
            {
                return(base.GetIconForNode(item));
            }
            if (this.IsVisibleRootNode(item))
            {
                return((Texture)this.k_FavoritesIcon);
            }
            if (searchFilterTreeItem.isFolder)
            {
                return((Texture)this.k_FavoriteFolderIcon);
            }
            return((Texture)this.k_FavoriteFilterIcon);
        }