style: add .editorconfig for code formatting. see issu #25

This commit is contained in:
leo 2024-03-18 09:37:06 +08:00
parent a8eeea4f78
commit 18aaa0a143
225 changed files with 7781 additions and 3911 deletions

View file

@ -2,23 +2,28 @@ using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
namespace SourceGit.Views {
public partial class Apply : UserControl {
public Apply() {
namespace SourceGit.Views
{
public partial class Apply : UserControl
{
public Apply()
{
InitializeComponent();
}
private async void SelectPatchFile(object sender, RoutedEventArgs e) {
private async void SelectPatchFile(object sender, RoutedEventArgs e)
{
var topLevel = TopLevel.GetTopLevel(this);
if (topLevel == null) return;
var options = new FilePickerOpenOptions() { AllowMultiple = false, FileTypeFilter = [ new FilePickerFileType("Patch File") { Patterns = ["*.patch"] }] };
var options = new FilePickerOpenOptions() { AllowMultiple = false, FileTypeFilter = [new FilePickerFileType("Patch File") { Patterns = ["*.patch"] }] };
var selected = await topLevel.StorageProvider.OpenFilePickerAsync(options);
if (selected.Count == 1) {
if (selected.Count == 1)
{
txtPatchFile.Text = selected[0].Path.LocalPath;
}
e.Handled = true;
}
}
}
}