Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve confirmation text #1639

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,31 @@

private void ddCategoriseMany_SelectedIndexChanged(object sender, EventArgs e)
{
var filteredObjects = olvColumnExtractability.FilteredObjects.Cast<ColPair>().ToArray();
ColPair[] filteredObjects = olvColumnExtractability.FilteredObjects.Cast<ColPair>().ToArray();
var toChangeTo = ddCategoriseMany.SelectedItem;
ColPair[] itemsToChange = filteredObjects.Where(obj => obj.ExtractionInformation is null || !obj.ExtractionInformation.ExtractionCategory.Equals(toChangeTo)).ToArray();
string columnChangeDetails = String.Format("{0}{1} columns",itemsToChange.Length == filteredObjects.Length?"all ":"",itemsToChange.Length);
if(itemsToChange.Length < 3)
{
columnChangeDetails = "";
foreach(var item in itemsToChange.Select((value, i) => new { i, value })) {
if (itemsToChange.Length > 1)
{
if (item.i == itemsToChange.Length - 1)
{
columnChangeDetails += " and ";
Fixed Show fixed Hide fixed
}
else if(item.i >0)
{
columnChangeDetails += ", ";
Fixed Show fixed Hide fixed
}
}
columnChangeDetails += item.value.CatalogueItem.Name;
Fixed Show fixed Hide fixed

if (MessageBox.Show($"Set {filteredObjects.Length} to '{toChangeTo}'?",
}
}

if (MessageBox.Show($"Set {columnChangeDetails} to '{toChangeTo}'?",
"Confirm Overwrite?", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
foreach (object o in filteredObjects)
Expand Down
Loading