예제 #1
0
        private void LoadItemCollection(long library_id)
        {
            ItemCollection.Clear();
            ContainerMovies.Visibility = Visibility.Visible;
            CastCollection.Clear();
            ContainerCast.Visibility          = Visibility.Collapsed;
            MainGrid.RowDefinitions[2].Height = new GridLength(0);

            lvMovies.ItemsSource = null;

            foreach (DataRow row in Database.GetMetadataItems(library_id).Rows)
            {
                ItemCollection.Add(new MetadataItem()
                {
                    id           = long.Parse(row["id"].ToString()),
                    title        = row["title"].ToString(),
                    release_date = TryParseNullableDateTime(row["release_date"].ToString()),
                    date_added   = TryParseNullableDateTime(row["date_added"].ToString()),
                    actor_count  = int.Parse(row["actor_count"].ToString()),
                    user_fields  = row["user_fields"].ToString()
                });
            }

            lvMovies.ItemsSource = ItemCollection;
            this.lvMovies.ColumnFromDisplayIndex(0).SortDirection = ListSortDirection.Ascending;
        }
예제 #2
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     lvMovies.SelectedItem = null;
     CastCollection.Clear();
     ContainerCast.Visibility          = Visibility.Collapsed;
     MainGrid.RowDefinitions[2].Height = new GridLength(0);
 }
예제 #3
0
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     Database.ResetTaggings((MetadataItem)lvMovies.SelectedItem, CastCollection);
     lvMovies.SelectedItem = null;
     CastCollection.Clear();
     ContainerCast.Visibility          = Visibility.Collapsed;
     MainGrid.RowDefinitions[2].Height = new GridLength(0);
 }
예제 #4
0
        private void LoadCastCollection(long item_id)
        {
            CastCollection.Clear();
            ContainerCast.Visibility          = Visibility.Visible;
            MainGrid.RowDefinitions[2].Height = new GridLength(65);
            autoActors.Text = string.Empty;

            lvActors.ItemsSource = null;

            foreach (DataRow row in Database.GetActors(item_id).Rows)
            {
                CastCollection.Add(new Actor()
                {
                    id  = long.Parse(row["id"].ToString()),
                    tag = row["tag"].ToString()
                });
            }

            lvActors.ItemsSource = CastCollection;
        }
예제 #5
0
        private void LoadLibraryCollection()
        {
            LibraryCollection.Clear();
            ContainerLibraries.Visibility = Visibility.Visible;
            ItemCollection.Clear();
            ContainerMovies.Visibility = Visibility.Collapsed;
            CastCollection.Clear();
            ContainerCast.Visibility          = Visibility.Collapsed;
            MainGrid.RowDefinitions[2].Height = new GridLength(0);

            lvLibrarySections.ItemsSource = null;

            foreach (DataRow row in Database.GetLibrarySections().Rows)
            {
                LibraryCollection.Add(new Library()
                {
                    id   = long.Parse(row["id"].ToString()),
                    name = row["name"].ToString()
                });
            }

            lvLibrarySections.ItemsSource = LibraryCollection;
        }