public LibraryFile(ClassFolder folder)
        {
            InitializeComponent();
            backgroundWorker = new BackgroundWorker();
            backgroundWorker.WorkerReportsProgress      = true;
            backgroundWorker.WorkerSupportsCancellation = true;

            backgroundWorker.DoWork             += BackgroundWorker_DoWork;
            backgroundWorker.ProgressChanged    += BackgroundWorker_ProgressChanged;
            backgroundWorker.RunWorkerCompleted += BackgroundWorker_RunWorkerCompleted;
            ClassFile files = new ClassFile();

            folders            = new ClassFolder();
            folders.namefolder = "Library";
            folders.listfile   = new List <ClassFile>();
            folders            = folder;
            ReadPDF            = new ReadPDF(files, folders);
            //foreach (Folder f in folders)
            //{
            //    cmbFolderName.Items.Add(f.namefolder);
            //}
            //if (cmbFolderName.Items != null)
            //{
            //    cmbFolderName.Text = cmbFolderName.Items[0].ToString();
            //}
            //else
            //{
            //    cmbFolderName.Text = "Library";
            //    cmbFolderName.Items.Add("Library");
            //}
        }
Esempio n. 2
0
        //Nháy chuột 2 lần mở File
        private void lstFileName_DoubleClick(object sender, EventArgs e)
        {
            ClassFile files = new ClassFile();

            files = FileController.getFile(int.Parse(lstFileName.SelectedItems[0].SubItems[3].Text));
            ClassFolder folder = new ClassFolder();

            folder  = FolderController.getFolder(txtNameFolder.Text);
            ReadPDF = new ReadPDF(files, folder);
            ReadPDF.Show();
        }
        private void lvwSearch_DoubleClick(object sender, EventArgs e)
        {
            List <ClassFile> files = new List <ClassFile>();

            //int indexfd = folders.FindIndex(x => x.namefolder == cmbFolderName.Text);
            files = folders.listfile.ToList <ClassFile>();
            int index = files.FindIndex(x => x.namefile == lvwSearch.SelectedItems[0].SubItems[1].Text + "\\"
                                        + lvwSearch.SelectedItems[0].SubItems[0].Text);

            ReadPDF = new ReadPDF(files[index], folders);
            ReadPDF.Show();
        }
        //Mở File
        private void lstFileName_DoubleClick(object sender, EventArgs e)
        {
            int indexfolder        = FolderController.getListFolder().FindIndex(x => x.namefolder == txtNameFolder.Text);
            List <ClassFile> files = new List <ClassFile>();

            files = FolderController.getListFolder()[indexfolder].listfile.ToList <ClassFile>();
            int index = files.FindIndex(x => x.namefile == lstFileName.SelectedItems[0].SubItems[1].Text + "\\"
                                        + lstFileName.SelectedItems[0].SubItems[0].Text);

            ReadPDF = new ReadPDF(files[index], FolderController.getListFolder()[indexfolder]);
            ReadPDF.Show();
        }