public static Form DecideForm() { var args = new List<string>(Environment.GetCommandLineArgs()); // TODO. if (args.Contains(@"-i") || args.Count <= 1 && !Installer.IsInstalled) { return new InstallForm(); } else if (args.Contains(@"-u") || args.Count <= 1 && Installer.IsInstalled) { return new UninstallForm(); } else if (args.Contains(@"-b") && args.Count == 3) { var r = new BackupForm(); r.Initialize(args[2]); return r; } else if (args.Contains(@"-r") && args.Count == 3) { var r = new RestoreForm(); r.Initialize(args[2]); return r; } else { throw new Exception("Unknown/invalid command line arguments."); } }
public static Form DecideForm() { var args = new List <string>(Environment.GetCommandLineArgs()); // TODO. if (args.Contains(@"-i") || args.Count <= 1 && !Installer.IsInstalled) { return(new InstallForm()); } else if (args.Contains(@"-u") || args.Count <= 1 && Installer.IsInstalled) { return(new UninstallForm()); } else if (args.Contains(@"-b") && args.Count == 3) { var r = new BackupForm(); r.Initialize(args[2]); return(r); } else if (args.Contains(@"-r") && args.Count == 3) { var r = new RestoreForm(); r.Initialize(args[2]); return(r); } else { throw new Exception("Unknown/invalid command line arguments."); } }
public void Restore() { try { using (var modal = new RestoreForm()) { modal.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "OperationError".GetUiTranslation(), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void RestoreMenuItem_Click(object sender, EventArgs e) { RestoreForm restoreForm = new RestoreForm(); DialogResult result = restoreForm.ShowDialog(); if (result == DialogResult.OK) { SPSiteCollection collection = CurrentNode.Tag as SPSiteCollection; Cursor.Current = Cursors.WaitCursor; collection.Restore( restoreForm.tbSiteName.Text, restoreForm.tbFilename.Text, restoreForm.cbOverride.Checked, restoreForm.cbHostHeader.Checked); Cursor.Current = Cursors.Default; } }