Beispiel #1
0
        private FileListItem MakeItemFromPath(string path)
        {
            var fileListItem = FileListItem.Create(path);
            var fullpath     = fileListItem.FullPath;
            var counter      = pagesCounters[Path.GetExtension(fullpath).ToLower()];

            if (counter != null)
            {
                Cursor cursor = this.Cursor;
                this.Cursor = Cursors.WaitCursor;

                try
                {
                    fileListItem.NumberOfPages = counter(fullpath);
                }
                catch (Exception ee)
                {
                    throw ee;
                }
                finally
                {
                    this.Cursor = cursor;
                }
            }

            return(fileListItem);
        }
        internal static FileListItem Create(string path)
        {
            string fullPath = Path.GetFullPath(path);

            ListViewItem item = new ListViewItem(Path.GetFileName(fullPath));

            item.SubItems.Add(string.Empty);                    // number of pages
            item.SubItems.Add(Path.GetDirectoryName(fullPath)); // directory name

            var fileListItem = new FileListItem(item);

            return(fileListItem);
        }
Beispiel #3
0
 public virtual void Remove(FileListItem item)
 {
     listView.Items.Remove(item.ListViewItem);
 }