fix<Dashboard>: fix .NET 4.8 compile warning

This commit is contained in:
leo 2021-05-28 09:59:02 +08:00
parent 5fbefad159
commit 53a1e069d1

View file

@ -401,10 +401,10 @@ namespace SourceGit.Views.Widgets {
private void OpenNewBranch(object sender, RoutedEventArgs e) {
var current = repo.Branches.Find(x => x.IsCurrent);
if (current != null) {
new Popups.CreateBranch(repo, current).Show();
} else {
Models.Exception.Raise(App.Text("CreateBranch.Idle"));
if (current != null) {
new Popups.CreateBranch(repo, current).Show();
} else {
Models.Exception.Raise(App.Text("CreateBranch.Idle"));
}
e.Handled = true;
}
@ -625,13 +625,13 @@ namespace SourceGit.Views.Widgets {
menu.Items.Add(tracking);
}
var archive = new MenuItem();
archive.Header = App.Text("Archive");
archive.Click += (o, e) => {
new Popups.Archive(repo.Path, branch).Show();
e.Handled = true;
};
menu.Items.Add(archive);
var archive = new MenuItem();
archive.Header = App.Text("Archive");
archive.Click += (o, e) => {
new Popups.Archive(repo.Path, branch).Show();
e.Handled = true;
};
menu.Items.Add(archive);
menu.Items.Add(new Separator());
var copy = new MenuItem();
@ -749,11 +749,11 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
};
var archive = new MenuItem();
archive.Header = App.Text("Archive");
archive.Click += (o, e) => {
new Popups.Archive(repo.Path, branch).Show();
e.Handled = true;
var archive = new MenuItem();
archive.Header = App.Text("Archive");
archive.Click += (o, e) => {
new Popups.Archive(repo.Path, branch).Show();
e.Handled = true;
};
var copy = new MenuItem();
@ -767,8 +767,8 @@ namespace SourceGit.Views.Widgets {
menu.Items.Add(new Separator());
menu.Items.Add(createBranch);
menu.Items.Add(createTag);
menu.Items.Add(new Separator());
menu.Items.Add(archive);
menu.Items.Add(new Separator());
menu.Items.Add(archive);
menu.Items.Add(new Separator());
menu.Items.Add(copy);
}
@ -815,11 +815,11 @@ namespace SourceGit.Views.Widgets {
ev.Handled = true;
};
var archive = new MenuItem();
archive.Header = App.Text("Archive");
archive.Click += (o, e) => {
new Popups.Archive(repo.Path, tag).Show();
e.Handled = true;
var archive = new MenuItem();
archive.Header = App.Text("Archive");
archive.Click += (o, ev) => {
new Popups.Archive(repo.Path, tag).Show();
ev.Handled = true;
};
var copy = new MenuItem();
@ -834,8 +834,8 @@ namespace SourceGit.Views.Widgets {
menu.Items.Add(new Separator());
menu.Items.Add(pushTag);
menu.Items.Add(deleteTag);
menu.Items.Add(new Separator());
menu.Items.Add(archive);
menu.Items.Add(new Separator());
menu.Items.Add(archive);
menu.Items.Add(new Separator());
menu.Items.Add(copy);
menu.IsOpen = true;