コード例 #1
0
        /// <summary>
        ///     Delete a new group item
        /// </summary>
        /// <param name="state">The item state</param>
        private static void Delete(ItemState state)
        {
            // Delete the actual object
            var item          = Utility.FindChild(HierarchyView.transform, state.ID);
            var hierarchyItem = item.GetComponent <HierarchyItemController>();

            HierarchyController.DeleteObject(hierarchyItem.item);

            // Delete the list view item and the selection
            HierarchyController.SelectedItems.Remove(hierarchyItem);
            HierarchyController.DeleteObject(item.gameObject);
        }
コード例 #2
0
        /// <summary>
        ///     Create a new group item
        /// </summary>
        /// <param name="state">The item state</param>
        private static void Create(ItemState state)
        {
            // Create the object
            var newObject = new GameObject(state.ID);

            newObject.AddComponent <ItemInfoController>();
            newObject.GetComponent <ItemInfoController>().ItemInfo
                = new ItemInfo {
                displayName = state.Name, isGroup = true, isFused = false
                };
            newObject.transform.parent = Model.transform;

            // Create the list view item
            HierarchyController.AddSingleListItem(HierarchyView, newObject, 0);

            // Move the item
            MoveCommand.Move(state);
        }
コード例 #3
0
ファイル: DatabaseView.cs プロジェクト: mikkoteras/auremo
        public DatabaseView(DataModel dataModel)
        {
            m_DataModel = dataModel;

            Artists = new ObservableCollection <IndexedLibraryItem>();
            AlbumsBySelectedArtists = new ObservableCollection <IndexedLibraryItem>();
            SongsOnSelectedAlbumsBySelectedArtists = new ObservableCollection <IndexedLibraryItem>();

            Genres = new ObservableCollection <IndexedLibraryItem>();
            AlbumsOfSelectedGenres = new ObservableCollection <IndexedLibraryItem>();
            SongsOnSelectedAlbumsOfSelectedGenres = new ObservableCollection <IndexedLibraryItem>();

            ArtistTree           = new ObservableCollection <HierarchicalLibraryItem>();
            ArtistTreeController = new HierarchyController(ArtistTree);

            GenreTree           = new ObservableCollection <HierarchicalLibraryItem>();
            GenreTreeController = new HierarchyController(GenreTree);

            DirectoryTree           = new ObservableCollection <HierarchicalLibraryItem>();
            DirectoryTreeController = new HierarchyController(DirectoryTree);

            m_DataModel.Database.PropertyChanged += new PropertyChangedEventHandler(OnDatabasePropertyChanged);
        }