Ejemplo n.º 1
0
        private void ContextClickItemCallback(int itemId)
        {
            GenericMenu g = new GenericMenu();

            g.AddItem(new GUIContent("Ping Item"), false, () =>
            {
                var item = m_TreeView.data.FindItem(m_TreeView.state.selectedIDs[0]);
                m_TreeView.Frame(item.id, true, true);
            });

            g.AddItem(new GUIContent("Show in Explorer"), false, () =>
            {
                var item = m_TreeView.data.FindItem(m_TreeView.state.selectedIDs[0]) as FolderTreeViewItem;
                WindowsOSUtility.ExploreDirectory(item.Path);
            });

            g.AddItem(new GUIContent("Create Folder"), false, () =>
            {
                var item = m_TreeView.data.FindItem(m_TreeView.state.selectedIDs[0]) as FolderTreeViewItem;
                CreateFolder(item);
            });

            g.AddItem(new GUIContent("Create txt"), false, () =>
            {
                var item = m_TreeView.data.FindItem(m_TreeView.state.selectedIDs[0]) as FolderTreeViewItem;
                CreateTxtFile(item);
            });
            g.ShowAsContext();
            Event.current.Use();
        }
Ejemplo n.º 2
0
        private void GridViewPopupMenuAction()
        {
            if (m_TreeView.state.selectedIDs.Count == 0)
            {
                return;
            }

            GenericMenu g = new GenericMenu();

            g.AddItem(new GUIContent("Create Folder"), false, () =>
            {
                CreateFolder();
            });

            g.AddItem(new GUIContent("Create txt"), false, () =>
            {
                CreateTxtFile();
            });

            g.AddItem(new GUIContent("Show in Explorer"), false, () =>
            {
                var item = (m_TreeView.isSearching ? m_TreeView.data.root : m_TreeView.data.FindItem(m_TreeView.state.selectedIDs[0])) as FolderTreeViewItem;
                WindowsOSUtility.ExploreDirectory(item.Path);
            });

            g.ShowAsContext();
        }
Ejemplo n.º 3
0
        private void ContextClickOutsideItemsCallback()
        {
            GenericMenu g = new GenericMenu();

            g.AddItem(new GUIContent("Show in Explorer"), false, () =>
            {
                var item = m_TreeView.data.root as FolderTreeViewItem;
                WindowsOSUtility.ExploreDirectory(item.Path);
            });
            g.ShowAsContext();
        }
        private void ItemDoubleClick(GridItem item)
        {
            var folderGridItem = item as FolderGridItem;

            if (folderGridItem.IsFolder)
            {
                m_SearchBar.ClearSearchText();
                m_TreeView.SetSelection(new int[] { item.Id }, true);
                UpdateGridViewContent();
                UpdateBreadcrumbBarContents();
            }
            else
            {
                WindowsOSUtility.OpenFileWithApp(folderGridItem.Path);
            }
        }
Ejemplo n.º 5
0
        private void GirdItemPopupMenuAction(GridItem item)
        {
            GenericMenu g = new GenericMenu();

            g.AddItem(new GUIContent("Ping Item"), false, () =>
            {
                m_FolderGridViewGroup.GetGridView().BeginPing(item.Id);
            });

            g.AddItem(new GUIContent("Show in Explorer"), false, () =>
            {
                WindowsOSUtility.ExploreDirectory((item as FolderGridItem).Path);
            });

            g.ShowAsContext();
        }