示例#1
0
 public void Init(Rect rect, BackendData backendData)
 {
     if (this.m_TreeView == null)
     {
         ITreeViewDataSource source;
         this.m_BackendData = backendData;
         TreeViewState treeViewState = new TreeViewState {
             columnWidths = new float[] { 250f, 90f, 93f, 98f, 74f, 78f }
         };
         this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState);
         ITreeViewGUI      gui      = new TestGUI(this.m_TreeView);
         ITreeViewDragging dragging = new TestDragging(this.m_TreeView, this.m_BackendData);
         if (this.m_Lazy)
         {
             source = new LazyTestDataSource(this.m_TreeView, this.m_BackendData);
         }
         else
         {
             source = new TestDataSource(this.m_TreeView, this.m_BackendData);
         }
         this.m_TreeView.Init(rect, source, gui, dragging);
         this.m_ColumnHeader = new TreeViewColumnHeader();
         this.m_ColumnHeader.columnWidths   = treeViewState.columnWidths;
         this.m_ColumnHeader.minColumnWidth = 30f;
         this.m_ColumnHeader.columnRenderer = (Action <int, Rect>)Delegate.Combine(this.m_ColumnHeader.columnRenderer, new Action <int, Rect>(this.OnColumnRenderer));
     }
 }
 public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
 {
   this.m_BackendData = backendData;
   TreeViewState treeViewState = new TreeViewState();
   this.m_TreeView = new TreeView(editorWindow, treeViewState);
   TestGUICustomItemHeights customItemHeights = new TestGUICustomItemHeights(this.m_TreeView);
   TestDragging testDragging = new TestDragging(this.m_TreeView, this.m_BackendData);
   TestDataSource testDataSource1 = new TestDataSource(this.m_TreeView, this.m_BackendData);
   TestDataSource testDataSource2 = testDataSource1;
   System.Action action = testDataSource2.onVisibleRowsChanged + new System.Action(((TreeViewGUIWithCustomItemsHeights) customItemHeights).CalculateRowRects);
   testDataSource2.onVisibleRowsChanged = action;
   this.m_TreeView.Init(rect, (ITreeViewDataSource) testDataSource1, (ITreeViewGUI) customItemHeights, (ITreeViewDragging) testDragging);
   testDataSource1.SetExpanded(testDataSource1.root, true);
 }
        public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
        {
            this.m_BackendData = backendData;
            TreeViewState treeViewState = new TreeViewState();

            this.m_TreeView = new TreeView(editorWindow, treeViewState);
            TestGUICustomItemHeights testGUICustomItemHeights = new TestGUICustomItemHeights(this.m_TreeView);
            TestDragging             dragging       = new TestDragging(this.m_TreeView, this.m_BackendData);
            TestDataSource           testDataSource = new TestDataSource(this.m_TreeView, this.m_BackendData);
            TestDataSource           expr_51        = testDataSource;

            expr_51.onVisibleRowsChanged = (Action)Delegate.Combine(expr_51.onVisibleRowsChanged, new Action(testGUICustomItemHeights.CalculateRowRects));
            this.m_TreeView.Init(rect, testDataSource, testGUICustomItemHeights, dragging);
            testDataSource.SetExpanded(testDataSource.root, true);
        }
        public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
        {
            this.m_BackendData = backendData;
            TreeViewState treeViewState = new TreeViewState();

            this.m_TreeView = new TreeView(editorWindow, treeViewState);
            TestGUICustomItemHeights customItemHeights = new TestGUICustomItemHeights(this.m_TreeView);
            TestDragging             testDragging      = new TestDragging(this.m_TreeView, this.m_BackendData);
            TestDataSource           testDataSource1   = new TestDataSource(this.m_TreeView, this.m_BackendData);
            TestDataSource           testDataSource2   = testDataSource1;

            System.Action action = testDataSource2.onVisibleRowsChanged + new System.Action(((TreeViewGUIWithCustomItemsHeights)customItemHeights).CalculateRowRects);
            testDataSource2.onVisibleRowsChanged = action;
            this.m_TreeView.Init(rect, (ITreeViewDataSource)testDataSource1, (ITreeViewGUI)customItemHeights, (ITreeViewDragging)testDragging);
            testDataSource1.SetExpanded(testDataSource1.root, true);
        }
        public TreeViewTestWithCustomHeight(EditorWindow editorWindow, BackendData backendData, Rect rect)
        {
            TestDataSource source;

            this.m_BackendData = backendData;
            TreeViewState treeViewState = new TreeViewState();

            this.m_TreeView = new TreeView(editorWindow, treeViewState);
            TestGUICustomItemHeights gui      = new TestGUICustomItemHeights(this.m_TreeView);
            TestDragging             dragging = new TestDragging(this.m_TreeView, this.m_BackendData);

            source = new TestDataSource(this.m_TreeView, this.m_BackendData)
            {
                onVisibleRowsChanged = (Action)Delegate.Combine(source.onVisibleRowsChanged, new Action(gui.CalculateRowRects))
            };
            this.m_TreeView.Init(rect, source, gui, dragging);
            source.SetExpanded(source.root, true);
        }