private static void AskUserAboutFileReplacement(FileInfo file1, FileInfo file2, [NotNull] MovieConfiguration pep, IDialogParent owner) { try { ChooseFile question = new ChooseFile(file1, file2); owner.ShowChildDialog(question); ChooseFile.ChooseFileDialogResult result = question.Answer; question.Dispose(); switch (result) { case ChooseFile.ChooseFileDialogResult.ignore: LOGGER.Info($" User has selected keeping {file1.FullName} and {file2.FullName} and they will not be merged"); return; case ChooseFile.ChooseFileDialogResult.left: UpgradeFile("User selected to", file1, pep, file2); return; case ChooseFile.ChooseFileDialogResult.right: UpgradeFile("User selected to", file2, pep, file1); return; default: throw new ArgumentOutOfRangeException(); } } catch (System.IO.FileNotFoundException) { return; } }
/// <summary> /// Constructor /// </summary> public SettingsViewModel() { // default color ResultColor = "Green"; LoadValues(); SaveConfigurations = new Save(this); Choose = new ChooseFile(this); }
// The TextBox that should be passed to this method is the one that shows the filename to be opened. public override void execute(ref int stackIndex, ref List <Command> stack) { textBox.Text = ChooseFile.getFileChoice(); }
public void UploadFile(string filePath) { ChooseFile.SendKeys(filePath); }