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 void Init(Rect rect, BackendData backendData)
 {
   if (this.m_TreeView != null)
     return;
   this.m_BackendData = backendData;
   TreeViewState treeViewState = new TreeViewState();
   treeViewState.columnWidths = new float[6]
   {
     250f,
     90f,
     93f,
     98f,
     74f,
     78f
   };
   this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState);
   ITreeViewGUI gui = (ITreeViewGUI) new TestGUI(this.m_TreeView);
   ITreeViewDragging dragging = (ITreeViewDragging) new TestDragging(this.m_TreeView, this.m_BackendData);
   ITreeViewDataSource data = !this.m_Lazy ? (ITreeViewDataSource) new TestDataSource(this.m_TreeView, this.m_BackendData) : (ITreeViewDataSource) new LazyTestDataSource(this.m_TreeView, this.m_BackendData);
   this.m_TreeView.Init(rect, data, gui, dragging);
   this.m_ColumnHeader = new TreeViewColumnHeader();
   this.m_ColumnHeader.columnWidths = treeViewState.columnWidths;
   this.m_ColumnHeader.minColumnWidth = 30f;
   this.m_ColumnHeader.columnRenderer += new System.Action<int, Rect>(this.OnColumnRenderer);
 }
Exemple #3
0
        public void Init(Rect rect, BackendData backendData)
        {
            if (this.m_TreeView != null)
            {
                return;
            }
            this.m_BackendData = backendData;
            TreeViewState treeViewState = new TreeViewState();

            treeViewState.columnWidths = new float[6]
            {
                250f,
                90f,
                93f,
                98f,
                74f,
                78f
            };
            this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState);
            ITreeViewGUI        gui      = (ITreeViewGUI) new TestGUI(this.m_TreeView);
            ITreeViewDragging   dragging = (ITreeViewDragging) new TestDragging(this.m_TreeView, this.m_BackendData);
            ITreeViewDataSource data     = !this.m_Lazy ? (ITreeViewDataSource) new TestDataSource(this.m_TreeView, this.m_BackendData) : (ITreeViewDataSource) new LazyTestDataSource(this.m_TreeView, this.m_BackendData);

            this.m_TreeView.Init(rect, data, gui, dragging);
            this.m_ColumnHeader = new TreeViewColumnHeader();
            this.m_ColumnHeader.columnWidths    = treeViewState.columnWidths;
            this.m_ColumnHeader.minColumnWidth  = 30f;
            this.m_ColumnHeader.columnRenderer += new System.Action <int, Rect>(this.OnColumnRenderer);
        }