void UpdateControls()
        {
            var selection = GetSelection().Count();

            currentDialog.EnableControl(ViewControl.AddButton, true);
            currentDialog.EnableControl(ViewControl.Import, true);
            currentDialog.EnableControl(ViewControl.EditButton, selection == 1);
            currentDialog.EnableControl(ViewControl.DeleteButton, selection > 0);
            currentDialog.EnableControl(ViewControl.Export, selection > 0);
            currentDialog.SetCloseButtonText(selection == 1 ? "Use and close" : "Close");
        }