public RevertForm(CommandRevert gitCommand) { InitializeComponent(); _gitCommand = gitCommand; _groups = new List <ListViewGroup>() { new ListViewGroup("VBDocuments", "Documents"), new ListViewGroup("VBForms", "Forms"), new ListViewGroup("VBModules", "Modules"), new ListViewGroup("VBClassModules", "Class Modules") }; RevertList.Groups.AddRange(_groups.ToArray()); ColumnName.Text = VBAGitUI.Name; ColumnExtension.Text = VBAGitUI.Extension; ColumnStatus.Text = VBAGitUI.Status; SelectAll.Text = VBAGitUI.RevertForm_SelectAll; EmptyRevertList.Text = VBAGitUI.RevertForm_EmptyRevertList; Ok.Text = VBAGitUI.OK; Cancel.Text = VBAGitUI.Cancel; Application.Idle += Application_Idle; }
/// <summary> /// Revert files in repository /// </summary> /// <param name="project">VBProject</param> public void Revert(VBProject project, IEnumerable <string> components = null) { try { EnableFileSystemWatcher = false; var repo = GetVBProjectRepository(project); using (var gitCommand = new CommandRevert(project, repo, components)) { gitCommand.Execute(); } } finally { EnableFileSystemWatcher = true; } }