Exemplo n.º 1
0
        private void List_View_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ListView_Item item = ((ListView)sender).SelectedItem as ListView_Item;

            if (item == null)
            {
                return;
            }
            else
            {
                System.Diagnostics.Process.Start(item.Path);
            }
        }
Exemplo n.º 2
0
        private void Add_File_To_ListView(FileInfo file)
        {
            bool ocr = false;


            ListView_Item item = new ListView_Item {
                Name = System.IO.Path.GetFileNameWithoutExtension(file.Name),
                Type = file.Extension,
                Path = file.FullName,
                OCR  = ocr
            };

            List_View.Items.Add(item);
        }
Exemplo n.º 3
0
        private void List_View_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Info_Textblock.Text = "";
            int count = e.AddedItems.Count;

            if (count > 0)
            {
                ListView_Item item     = (ListView_Item)e.AddedItems[0];
                FileInfo      fileinfo = new FileInfo(((ListView_Item)e.AddedItems[0]).Path);
                Task.Factory.StartNew(() =>
                {
                    File_Info_Textblock.Dispatcher.BeginInvoke(new Action(() => {
                        File_Info_Textblock.Text = $"Folder:{Environment.NewLine}{fileinfo.DirectoryName}{Environment.NewLine}{Environment.NewLine}" +
                                                   $"Type: {fileinfo.Extension}{Environment.NewLine}{Environment.NewLine}" +
                                                   $"Size: {BytesToString(fileinfo.Length)}";
                    }));
                });
                if (item.Type == ".pdf")
                {
                    Info_Textblock.Text = Pdf_get_metadata(item.Path);
                }
            }
        }