Exemplo n.º 1
0
        private void GridView1_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            GridView gridView = (GridView)sender;

            // Single or multiple items selected?
            if (gridView1.SelectedItems.Count > 1)
            {
                multiFileSelectedFlyout.ShowAt(gridView, e.GetPosition(gridView));
            }
            else
            {
                // Right click takes effect on right clicked file, not selected file.
                rightClickedFile = ((FrameworkElement)e.OriginalSource).DataContext as VideoFile;

                if (rightClickedFile.Screen == null)
                {
                    videoMenuFlyout.Items[1].Visibility = Visibility.Collapsed;
                }

                videoMenuFlyout.ShowAt(gridView, e.GetPosition(gridView));
            }
        }
Exemplo n.º 2
0
        private async void Grid_Drop(object sender, DragEventArgs e)
        {
            if (e.DataView.Contains(StandardDataFormats.StorageItems))
            {
                var items = await e.DataView.GetStorageItemsAsync();

                if (items.Count > 0)
                {
                    foreach (StorageFile file in items)
                    {
                        // If it is video
                        if (VideoFile.IsSupportedVideoType(file))
                        {
                            if (!paths.Contains(file.Path))
                            {
                                importingList.Add(new VideoFile(file));
                                paths.Add(file.Path);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        public static List <VideoFile> GetVideoList()
        {
            List <VideoFile> entries = new List <VideoFile>();

            using (SqliteConnection db = new SqliteConnection("Filename=sqliteSample.db"))
            {
                db.Open();

                SqliteCommand selectCommand = new SqliteCommand
                                                  ("SELECT FileId, Path FROM FILE", db);

                SqliteDataReader query = selectCommand.ExecuteReader();

                while (query.Read())
                {
                    VideoFile temp = new VideoFile(query.GetInt16(0), query.GetString(1));
                    entries.Add(temp);
                }

                db.Close();
            }

            return(entries);
        }