mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feature: workspace support (#445)
This commit is contained in:
parent
acd6171350
commit
ebc112a627
27 changed files with 473 additions and 109 deletions
58
src/ViewModels/Workspace.cs
Normal file
58
src/ViewModels/Workspace.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using Avalonia.Media;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class Workspace : ObservableObject
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, value);
|
||||
}
|
||||
|
||||
public uint Color
|
||||
{
|
||||
get => _color;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _color, value))
|
||||
Brush = new SolidColorBrush(value);
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> Repositories
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new List<string>();
|
||||
|
||||
public bool IsActive
|
||||
{
|
||||
get => _isActive;
|
||||
set => SetProperty(ref _isActive, value);
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public IBrush Brush
|
||||
{
|
||||
get => _brush;
|
||||
private set => SetProperty(ref _brush, value);
|
||||
}
|
||||
|
||||
public void AddRepository(string repo)
|
||||
{
|
||||
if (!Repositories.Contains(repo))
|
||||
Repositories.Add(repo);
|
||||
}
|
||||
|
||||
private string _name = string.Empty;
|
||||
private uint _color = 0;
|
||||
private IBrush _brush = null;
|
||||
private bool _isActive = false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue