/// <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); }
/// <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); }
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); }