35 lines
958 B
C#
35 lines
958 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Eto.Forms;
|
|
using UpToolLib.DataStructures;
|
|
|
|
namespace UpToolEto.Controls
|
|
{
|
|
public class RepoItem : StackLayout
|
|
{
|
|
public RepoItem(Repo repo, int index, Action update, IList<Repo> repos)
|
|
{
|
|
TextBox name = new()
|
|
{
|
|
Text = repo.Name
|
|
};
|
|
name.TextChanged += (_, _) => repo.Name = name.Text;
|
|
TextBox link = new()
|
|
{
|
|
Text = repo.Url
|
|
};
|
|
link.TextChanged += (_, _) => repo.Url = link.Text;
|
|
Orientation = Orientation.Horizontal;
|
|
Items.Add(name);
|
|
Items.Add(new StackLayoutItem(link, HorizontalAlignment.Stretch, true));
|
|
Items.Add(new Button((_, _) =>
|
|
{
|
|
repos.RemoveAt(index);
|
|
update();
|
|
})
|
|
{
|
|
Text = "-"
|
|
});
|
|
}
|
|
}
|
|
} |