private void FileNameBox_MouseDown(object sender, MouseEventArgs e) { if (FileNameBox.SelectedItem == null) { return; } FileNameBox.DoDragDrop(FileNameBox.SelectedItem, DragDropEffects.Move); }
private void FileNameBox_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { if (FileNameBox.SelectedItem == null) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] fileNames; fileNames = (string[])e.Data.GetData(DataFormats.FileDrop); //if (actionSelected == (int)features.Merge) { foreach (string name in fileNames) { int length = name.Length - 1; string temp = System.IO.Path.GetExtension(name).ToLower(); string[] split = name.Split('\\'); if (temp == ".pdf") { FileNameBox.Items.Add(split[split.Length - 1]); PathsListBox.Items.Add(name); } } } //else if (actionSelected == (int)features.Explode) //{ // int length = fileNames[0].Length - 1; // string temp = fileNames[0].Substring(length - 2); // string[] split = fileNames[0].Split('\\'); // if (temp == "pdf") // { // FileNameBox.Items.Clear(); // PathsListBox.Items.Clear(); // FileNameBox.Items.Add(split[split.Length - 1]); // PathsListBox.Items.Add(fileNames[0]); // } //} } } else { if (PathsListBox.SelectedItem == null) { Point point = FileNameBox.PointToClient(new Point(e.X, e.Y)); int index = FileNameBox.IndexFromPoint(point); if (index < 0) { index = FileNameBox.Items.Count - 1; } object dataFileNameBox = e.Data.GetData(DataFormats.Text); object dataPathsListBox = PathsListBox.Items[FileNameBox.SelectedIndex]; PathsListBox.Items.Remove(dataPathsListBox); PathsListBox.Items.Insert(index, dataPathsListBox); FileNameBox.Items.Remove(dataFileNameBox); FileNameBox.Items.Insert(index, dataFileNameBox); } } }
private void HideMergeItems() { InstructionsLabel1.Hide(); InstructionsLabel2.Hide(); FileNameBox.Hide(); PathsListBox.Hide(); DestinationFilePathTextBox.Hide(); RemoveButton.Hide(); RemoveAllButton.Hide(); GoButton.Hide(); HidePathsButton.Hide(); }
private void UpdateListBox() { if (WorkingArchive != null) { List <string> filenames = WorkingArchive.FileList; FileNameBox.BeginUpdate(); FileNameBox.Items.Clear(); foreach (string fname in filenames) { FileNameBox.Items.Add(fname); } FileNameBox.EndUpdate(); } }
private void ShowExplodeItems() { InstructionsLabel1.Show(); InstructionsLabel1.Text = "Drag and drop PDF files to explode, into the box below:"; //InstructionsLabel2.Show(); //InstructionsLabel2.Text = "Full file path for exploded pages"; FileNameBox.Show(); PathsListBox.Show(); //DestinationFilePathTextBox.Show(); //DestinationFilePathTextBox.Text = destinationFilePath; RemoveButton.Show(); RemoveAllButton.Show(); GoButton.Show(); GoButton.Text = "Kaboom!"; HidePathsButton.Show(); HidePathsButton.Text = "Hide Paths"; }
private void ShowMergeItems() { InstructionsLabel1.Show(); InstructionsLabel1.Text = "Drag and drop PDF files to merge, into the box below:"; InstructionsLabel2.Show(); InstructionsLabel2.Text = "Full file path for merged file:"; FileNameBox.Show(); PathsListBox.Show(); DestinationFilePathTextBox.Show(); DestinationFilePathTextBox.Text = destinationFilePath; RemoveButton.Show(); RemoveAllButton.Show(); GoButton.Show(); GoButton.Text = "Merge"; HidePathsButton.Show(); HidePathsButton.Text = "Hide Paths"; }
private void ShowStampItems() { InstructionsLabel1.Show(); InstructionsLabel1.Text = "Drag and drop PDF files that need stamping, into the box below:"; InstructionsLabel2.Show(); InstructionsLabel2.Text = "Drag and drop image/PDF into the box:"; FileNameBox.Show(); PathsListBox.Show(); StampFileBox.Show(); RemoveButton.Show(); RemoveAllButton.Show(); RemoveImageButton.Show(); GoButton.Show(); GoButton.Text = "Stamp"; HidePathsButton.Show(); HidePathsButton.Text = "Hide Paths"; StampAllButton.Show(); StampAllButton.Checked = true; StampLastPageButton.Show(); }