コード例 #1
0
        public void loadFiles()
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Filter      = "Image files (*.jpg, *.jpeg, *.png, *.bmp, *.gif)|*.jpg;*.jpeg;*.png;*.bmp;*.gif";
            dialog.Title       = "Load images to the new category...";
            dialog.Multiselect = true;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                int categoryId = categoryIndex++;

                IFileCategory category = new FileCategory();
                category.SetId(categoryId);
                category.SetName("Category " + categoryId);

                IFileList fileList = new FileList();
                int       fileId   = 0;
                foreach (String filePath in dialog.FileNames)
                {
                    IFile file = new File();
                    file.SetPath(filePath);
                    file.SetId(fileId++);

                    fileList.AddFile(file);
                }

                category.SetFileList(fileList);
                _categoriesList.AddCategory(category);
            }
        }
コード例 #2
0
 private void FolderTree_ShowFolder(object sender, FilesEventArgs e)
 {
     CurrentPath.Text  = e.Path;
     FileList.FullPath = e.Path;
     FileList.BeginUpdate();
     FileList.Items.Clear();
     if (e.File != null)
     {
         foreach (NexonArchiveFileEntry entry in e.File)
         {
             FileList.AddFile(entry);
         }
     }
     FileList.EndUpdate();
     FileList_SelectedIndexChanged(this, EventArgs.Empty);
 }