-
Notifications
You must be signed in to change notification settings - Fork 386
Expand file tree
/
Copy pathCustomAction.cs
More file actions
109 lines (93 loc) · 2.56 KB
/
CustomAction.cs
File metadata and controls
109 lines (93 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using Avalonia.Collections;
using CommunityToolkit.Mvvm.ComponentModel;
namespace SourceGit.Models
{
public enum CustomActionScope
{
Repository,
Commit,
Branch,
Tag,
Remote,
File,
}
public enum CustomActionControlType
{
TextBox = 0,
PathSelector,
CheckBox,
ComboBox,
}
public record CustomActionTargetFile(string File, Commit Revision);
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
{
get => _name;
set => SetProperty(ref _name, value);
}
public CustomActionScope Scope
{
get => _scope;
set => SetProperty(ref _scope, value);
}
public string Executable
{
get => _executable;
set => SetProperty(ref _executable, value);
}
public string Arguments
{
get => _arguments;
set => SetProperty(ref _arguments, value);
}
public AvaloniaList<CustomActionControl> Controls
{
get;
set;
} = [];
public bool WaitForExit
{
get => _waitForExit;
set => SetProperty(ref _waitForExit, value);
}
private string _name = string.Empty;
private CustomActionScope _scope = CustomActionScope.Repository;
private string _executable = string.Empty;
private string _arguments = string.Empty;
private bool _waitForExit = true;
}
}