Ejemplo n.º 1
0
        /// <summary>
        /// Default ItemTypeManager constructor.
        /// </summary>
        public ItemTypeManager()
        {
            // Create the category TreeView.
            m_CategoryTreeViewState = new TreeViewState();
            var itemTypeModal = new ItemTypeCollectionModal();
            var categoryModal = new CategoryCollectionModal();

            categoryModal.BeforeModalChange += OnTreeWillChange;
            categoryModal.AfterModalChange  += OnTreeChangeReload;
            m_CategoryTreeView             = new FlatTreeView <CategoryCollectionModal>(m_CategoryTreeViewState, categoryModal);
            m_CategoryTreeView.TreeChange += OnTreeChange;
            m_CategorySearchField          = new SearchField();
            m_CategorySearchField.downOrUpArrowKeyPressed += m_CategoryTreeView.SetFocusAndEnsureSelectedItem;

            // Create the ItemType TreeView.
            m_ItemTypeTreeViewState          = new TreeViewState();
            itemTypeModal.BeforeModalChange += OnTreeWillChange;
            itemTypeModal.AfterModalChange  += OnTreeChangeReload;
            m_ItemTypeTreeView             = new FlatTreeView <ItemTypeCollectionModal>(m_ItemTypeTreeViewState, itemTypeModal);
            m_ItemTypeTreeView.TreeChange += OnTreeChange;
            m_ItemTypeSearchField          = new SearchField();
            m_ItemTypeSearchField.downOrUpArrowKeyPressed += m_ItemTypeTreeView.SetFocusAndEnsureSelectedItem;

            Undo.undoRedoPerformed += OnUndoRedo;
        }
Ejemplo n.º 2
0
 void InitIfNeeded()
 {
     if (!m_Initialized)
     {
         // Check if it already exists (deserialized from window layout file or scriptable object)
         if (m_TreeViewState == null)
         {
             m_TreeViewState = new TreeViewState();
         }
         m_TreeView    = new FlatTreeView(m_TreeViewState);
         m_Initialized = true;
         //m_SearchField.downOrUpArrowKeyPressed += m_TreeView.SetFocusAndEnsureSelectedItem;
     }
 }
Ejemplo n.º 3
0
        public void TestCtor()
        {
            var tree = new FlatTreeView();

            tree.IsExpandable.Should().BeTrue();
        }