mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
feature: support git.core.askpass (#239)
This commit is contained in:
parent
8fa19ecd0c
commit
cbe4c36525
14 changed files with 211 additions and 60 deletions
52
src/Views/Askpass.axaml.cs
Normal file
52
src/Views/Askpass.axaml.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class Askpass : ChromelessWindow
|
||||
{
|
||||
public string KeyName
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
} = string.Empty;
|
||||
|
||||
public string Passphrase
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = string.Empty;
|
||||
|
||||
public Askpass()
|
||||
{
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Askpass(string keyname)
|
||||
{
|
||||
KeyName = keyname;
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void BeginMoveWindow(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
|
||||
private void CloseWindow(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.Out.WriteLine("No passphrase entered.");
|
||||
Environment.Exit(-1);
|
||||
}
|
||||
|
||||
private void EnterPassword(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Console.Out.Write($"{Passphrase}\n");
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue