allow remove updates from update collector
This commit is contained in:
@@ -138,7 +138,6 @@ partial class UpdatesCollectorUi
|
||||
// radListView_Updates
|
||||
//
|
||||
radListView_Updates.AllowEdit = false;
|
||||
radListView_Updates.AllowRemove = false;
|
||||
radListView_Updates.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
listViewDetailColumn1.HeaderText = "Name";
|
||||
listViewDetailColumn2.HeaderText = "Current version";
|
||||
@@ -153,6 +152,7 @@ partial class UpdatesCollectorUi
|
||||
radListView_Updates.TabIndex = 0;
|
||||
radListView_Updates.ViewType = Telerik.WinControls.UI.ListViewType.DetailsView;
|
||||
radListView_Updates.SelectedItemChanged += RadListView_Updates_SelectedItemChanged;
|
||||
radListView_Updates.ItemRemoved += RadListView_Updates_ItemRemoved;
|
||||
//
|
||||
// splitPanel2
|
||||
//
|
||||
|
||||
@@ -11,7 +11,7 @@ public partial class UpdatesCollectorUi : RadForm
|
||||
public int NewVersion { get; set; } = 0;
|
||||
}
|
||||
|
||||
public record ModUpdates(IEnumerable<ModUpdateInfo> List);
|
||||
public record ModUpdates(List<ModUpdateInfo> List);
|
||||
|
||||
private readonly IWorkspace workspace;
|
||||
private readonly ModpackFactory factory = new();
|
||||
@@ -117,4 +117,10 @@ public partial class UpdatesCollectorUi : RadForm
|
||||
UpdateUpdatesItem(radListView_Updates.SelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void RadListView_Updates_ItemRemoved(object sender, ListViewItemEventArgs e)
|
||||
{
|
||||
if (e.Item?.Value is ModUpdateInfo update && CurrentUpdates is not null && CurrentUpdates.List.Contains(update))
|
||||
CurrentUpdates.List.Remove(update);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user