add/remove action rows
This commit is contained in:
@@ -18,7 +18,9 @@ public partial class MainForm : RadForm, IMainApi
|
||||
{
|
||||
private WorkspaceTag? wsInfo;
|
||||
|
||||
IWorkspace? IMainApi.Workspace => wsInfo?.Workspace;
|
||||
IWorkspace? IMainApi.CurWorkspace => wsInfo?.Workspace;
|
||||
|
||||
public IActionSetInfos? CurActionSet => CurActionSet as IActionSetInfos;
|
||||
|
||||
private record RecentFilesItemTag(WorkspaceConfig Config, WorkspaceFeature Feature);
|
||||
|
||||
@@ -510,4 +512,32 @@ public partial class MainForm : RadForm, IMainApi
|
||||
radListControl_Updates.Items.Remove(radListControl_Updates.SelectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
private void RadGridView_Actions_UserAddingRow(object sender, GridViewRowCancelEventArgs e)
|
||||
{
|
||||
foreach (var row in e.Rows)
|
||||
row.Tag = CurActionSet is UpdateInfo ? new UpdateAction() : new InstallAction();
|
||||
}
|
||||
|
||||
private void RadGridView_Actions_UserAddedRow(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
foreach (var row in e.Rows)
|
||||
{
|
||||
if (row.Tag is UpdateAction uaction && CurActionSet is UpdateInfo uinfo && !uinfo.Actions.Contains(uaction))
|
||||
uinfo.Actions.Add(uaction);
|
||||
else if (row.Tag is InstallAction iaction && CurActionSet is InstallInfos iinfo && !iinfo.Actions.Contains(iaction))
|
||||
iinfo.Actions.Add(iaction);
|
||||
}
|
||||
}
|
||||
|
||||
private void RadGridView_Actions_UserDeletedRow(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
foreach (var row in e.Rows)
|
||||
{
|
||||
if (row.Tag is UpdateAction uaction && CurActionSet is UpdateInfo uinfo)
|
||||
uinfo.Actions.Remove(uaction);
|
||||
else if (row.Tag is InstallAction iaction && CurActionSet is InstallInfos iinfo)
|
||||
iinfo.Actions.Remove(iaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user