mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-27 05:15:05 +00:00
feature: support to use input control in custom action
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
a8803ca188
commit
676785f8b1
26 changed files with 659 additions and 56 deletions
|
@ -1,4 +1,5 @@
|
|||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Avalonia.Collections;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
|
@ -9,6 +10,52 @@ namespace SourceGit.Models
|
|||
Branch,
|
||||
}
|
||||
|
||||
public enum CustomActionControlType
|
||||
{
|
||||
TextBox = 0,
|
||||
PathSelector,
|
||||
CheckBox,
|
||||
}
|
||||
|
||||
public class CustomActionControl : ObservableObject
|
||||
{
|
||||
public CustomActionControlType Type
|
||||
{
|
||||
get => _type;
|
||||
set => SetProperty(ref _type, value);
|
||||
}
|
||||
|
||||
public string Label
|
||||
{
|
||||
get => _label;
|
||||
set => SetProperty(ref _label, value);
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get => _description;
|
||||
set => SetProperty(ref _description, value);
|
||||
}
|
||||
|
||||
public string StringValue
|
||||
{
|
||||
get => _stringValue;
|
||||
set => SetProperty(ref _stringValue, value);
|
||||
}
|
||||
|
||||
public bool BoolValue
|
||||
{
|
||||
get => _boolValue;
|
||||
set => SetProperty(ref _boolValue, value);
|
||||
}
|
||||
|
||||
private CustomActionControlType _type = CustomActionControlType.TextBox;
|
||||
private string _label = string.Empty;
|
||||
private string _description = string.Empty;
|
||||
private string _stringValue = string.Empty;
|
||||
private bool _boolValue = false;
|
||||
}
|
||||
|
||||
public class CustomAction : ObservableObject
|
||||
{
|
||||
public string Name
|
||||
|
@ -35,6 +82,12 @@ namespace SourceGit.Models
|
|||
set => SetProperty(ref _arguments, value);
|
||||
}
|
||||
|
||||
public AvaloniaList<CustomActionControl> Controls
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = [];
|
||||
|
||||
public bool WaitForExit
|
||||
{
|
||||
get => _waitForExit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue