Inheritance: TreeViewDataSource
 public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func<List<AudioMixerController>> getAllControllersCallback)
 {
     this.m_TreeView = new TreeViewController(mixerWindow, treeState);
     this.m_TreeView.deselectOnUnhandledMouseDown = false;
     this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged));
     this.m_TreeView.contextClickItemCallback = (Action<int>) Delegate.Combine(this.m_TreeView.contextClickItemCallback, new Action<int>(this.OnTreeViewContextClick));
     AudioMixersTreeViewGUI gui = new AudioMixersTreeViewGUI(this.m_TreeView);
     AudioMixersDataSource data = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
     AudioMixerTreeViewDragging dragging = new AudioMixerTreeViewDragging(this.m_TreeView, new Action<List<AudioMixerController>, AudioMixerController>(this, (IntPtr) this.OnMixersDroppedOnMixerCallback));
     this.m_TreeView.Init(mixerWindow.position, data, gui, dragging);
     this.m_TreeView.ReloadData();
 }
 public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func<List<AudioMixerController>> getAllControllersCallback)
 {
   this.m_TreeView = new TreeView((EditorWindow) mixerWindow, treeState);
   this.m_TreeView.deselectOnUnhandledMouseDown = false;
   this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.OnTreeSelectionChanged);
   this.m_TreeView.contextClickItemCallback += new System.Action<int>(this.OnTreeViewContextClick);
   AudioMixersTreeViewGUI mixersTreeViewGui = new AudioMixersTreeViewGUI(this.m_TreeView);
   AudioMixersDataSource mixersDataSource = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
   AudioMixerTreeViewDragging treeViewDragging = new AudioMixerTreeViewDragging(this.m_TreeView, new System.Action<List<AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback));
   this.m_TreeView.Init(mixerWindow.position, (ITreeViewDataSource) mixersDataSource, (ITreeViewGUI) mixersTreeViewGui, (ITreeViewDragging) treeViewDragging);
   this.m_TreeView.ReloadData();
 }
示例#3
0
        public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func <List <AudioMixerController> > getAllControllersCallback)
        {
            this.m_TreeView = new TreeViewController(mixerWindow, treeState);
            this.m_TreeView.deselectOnUnhandledMouseDown = false;
            this.m_TreeView.selectionChangedCallback     = (Action <int[]>)Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action <int[]>(this.OnTreeSelectionChanged));
            this.m_TreeView.contextClickItemCallback     = (Action <int>)Delegate.Combine(this.m_TreeView.contextClickItemCallback, new Action <int>(this.OnTreeViewContextClick));
            AudioMixersTreeViewGUI     gui      = new AudioMixersTreeViewGUI(this.m_TreeView);
            AudioMixersDataSource      data     = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
            AudioMixerTreeViewDragging dragging = new AudioMixerTreeViewDragging(this.m_TreeView, new Action <List <AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback));

            this.m_TreeView.Init(mixerWindow.position, data, gui, dragging);
            this.m_TreeView.ReloadData();
        }
示例#4
0
        public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func <List <AudioMixerController> > getAllControllersCallback)
        {
            this.m_TreeView = new TreeView((EditorWindow)mixerWindow, treeState);
            this.m_TreeView.deselectOnUnhandledMouseDown = false;
            this.m_TreeView.selectionChangedCallback    += new System.Action <int[]>(this.OnTreeSelectionChanged);
            this.m_TreeView.contextClickItemCallback    += new System.Action <int>(this.OnTreeViewContextClick);
            AudioMixersTreeViewGUI     mixersTreeViewGui = new AudioMixersTreeViewGUI(this.m_TreeView);
            AudioMixersDataSource      mixersDataSource  = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
            AudioMixerTreeViewDragging treeViewDragging  = new AudioMixerTreeViewDragging(this.m_TreeView, new System.Action <List <AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback));

            this.m_TreeView.Init(mixerWindow.position, (ITreeViewDataSource)mixersDataSource, (ITreeViewGUI)mixersTreeViewGui, (ITreeViewDragging)treeViewDragging);
            this.m_TreeView.ReloadData();
        }
        public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func <List <AudioMixerController> > getAllControllersCallback)
        {
            m_TreeView = new TreeViewController(mixerWindow, treeState);
            m_TreeView.deselectOnUnhandledMouseDown = false;
            m_TreeView.selectionChangedCallback    += OnTreeSelectionChanged;
            m_TreeView.contextClickItemCallback    += OnTreeViewContextClick;

            var treeViewGUI        = new AudioMixersTreeViewGUI(m_TreeView);
            var treeViewDataSource = new AudioMixersDataSource(m_TreeView, getAllControllersCallback);
            var treeViewDragging   = new AudioMixerTreeViewDragging(m_TreeView, OnMixersDroppedOnMixerCallback);

            m_TreeView.Init(mixerWindow.position, treeViewDataSource, treeViewGUI, treeViewDragging);
            m_TreeView.ReloadData();
        }
        public override void FetchData()
        {
            int  depth = -1;
            bool flag  = this.m_TreeView.state.expandedIDs.Count == 0;

            this.m_RootItem = new TreeViewItem(1010101010, depth, null, "InvisibleRoot");
            this.SetExpanded(this.m_RootItem.id, true);
            List <AudioMixerController> list = this.m_GetAllControllersCallback();

            this.m_NeedRefreshVisibleFolders = true;
            if (list.Count > 0)
            {
                List <AudioMixerItem> list2 = (from mixer in list
                                               select new AudioMixerItem(mixer.GetInstanceID(), 0, this.m_RootItem, mixer.name, mixer, AudioMixersDataSource.GetInfoText(mixer))).ToList <AudioMixerItem>();
                foreach (AudioMixerItem current in list2)
                {
                    this.SetChildParentOfMixerItem(current, list2);
                }
                this.SetItemDepthRecursive(this.m_RootItem, -1);
                this.SortRecursive(this.m_RootItem);
                if (flag)
                {
                    this.m_TreeView.data.SetExpandedWithChildren(this.m_RootItem, true);
                }
            }
        }
        public override void FetchData()
        {
            int  depth = -1;
            bool flag  = this.m_TreeView.state.expandedIDs.Count == 0;

            this.m_RootItem = new TreeViewItem(1010101010, depth, (TreeViewItem)null, "InvisibleRoot");
            this.SetExpanded(this.m_RootItem.id, true);
            List <AudioMixerController> source = this.m_GetAllControllersCallback();

            this.m_NeedRefreshVisibleFolders = true;
            if (source.Count <= 0)
            {
                return;
            }
            List <AudioMixerItem> list = source.Select <AudioMixerController, AudioMixerItem>((Func <AudioMixerController, AudioMixerItem>)(mixer => new AudioMixerItem(mixer.GetInstanceID(), 0, this.m_RootItem, mixer.name, mixer, AudioMixersDataSource.GetInfoText(mixer)))).ToList <AudioMixerItem>();

            using (List <AudioMixerItem> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    this.SetChildParentOfMixerItem(enumerator.Current, list);
                }
            }
            this.SetItemDepthRecursive(this.m_RootItem, -1);
            this.SortRecursive(this.m_RootItem);
            if (!flag)
            {
                return;
            }
            this.m_TreeView.data.SetExpandedWithChildren(this.m_RootItem, true);
        }