From 2b9d07479df96c9e277f97c9d62d1752beb72c9a Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 12 Jan 2022 18:43:21 +0800 Subject: [PATCH] rename: rename Views.Histories to Views.FileHistories --- src/Models/Version.cs | 4 ++-- src/Views/Controls/Avatar.cs | 4 ++-- src/Views/{Histories.xaml => FileHistories.xaml} | 2 +- src/Views/{Histories.xaml.cs => FileHistories.xaml.cs} | 4 ++-- src/Views/Widgets/CommitChanges.xaml.cs | 2 +- src/Views/Widgets/CommitDetail.xaml.cs | 2 +- src/Views/Widgets/RevisionFiles.xaml.cs | 2 +- src/Views/Widgets/WorkingCopyChanges.xaml.cs | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) rename src/Views/{Histories.xaml => FileHistories.xaml} (99%) rename src/Views/{Histories.xaml.cs => FileHistories.xaml.cs} (94%) diff --git a/src/Models/Version.cs b/src/Models/Version.cs index d0744b68..07ff3041 100644 --- a/src/Models/Version.cs +++ b/src/Models/Version.cs @@ -5,7 +5,7 @@ using System.Text.Json.Serialization; using System.Text.RegularExpressions; using System.Threading.Tasks; -#if NET6_0_OR_GREATER +#if NET6_0 using System.Net.Http; #else using System.Net; @@ -50,7 +50,7 @@ namespace SourceGit.Models { Preference.Instance.General.LastCheckDay = curDayOfYear; Task.Run(async () => { try { -#if NET6_0_OR_GREATER +#if NET6_0 var req = new HttpClient(); var rsp = await req.GetAsync("https://api.github.com/repos/sourcegit-scm/sourcegit/releases/latest"); rsp.EnsureSuccessStatusCode(); diff --git a/src/Views/Controls/Avatar.cs b/src/Views/Controls/Avatar.cs index 3043850e..45fbb539 100644 --- a/src/Views/Controls/Avatar.cs +++ b/src/Views/Controls/Avatar.cs @@ -11,7 +11,7 @@ using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Imaging; -#if NET6_0_OR_GREATER +#if NET6_0 using System.Net.Http; #endif @@ -196,7 +196,7 @@ namespace SourceGit.Views.Controls { if (!requesting.ContainsKey(email)) return; try { -#if NET6_0_OR_GREATER +#if NET6_0 var req = new HttpClient().GetAsync(Models.Preference.Instance.General.AvatarServer + md5 + "?d=404"); req.Wait(); diff --git a/src/Views/Histories.xaml b/src/Views/FileHistories.xaml similarity index 99% rename from src/Views/Histories.xaml rename to src/Views/FileHistories.xaml index cf8b6ebc..84f68297 100644 --- a/src/Views/Histories.xaml +++ b/src/Views/FileHistories.xaml @@ -1,5 +1,5 @@ /// 文件历史 /// - public partial class Histories : Controls.Window { + public partial class FileHistories : Controls.Window { private string repo = null; private string file = null; private bool isLFSEnabled = false; - public Histories(string repo, string file) { + public FileHistories(string repo, string file) { this.repo = repo; this.file = file; this.isLFSEnabled = new Commands.LFS(repo).IsFiltered(file); diff --git a/src/Views/Widgets/CommitChanges.xaml.cs b/src/Views/Widgets/CommitChanges.xaml.cs index 87796b8d..f8b482cf 100644 --- a/src/Views/Widgets/CommitChanges.xaml.cs +++ b/src/Views/Widgets/CommitChanges.xaml.cs @@ -237,7 +237,7 @@ namespace SourceGit.Views.Widgets { var history = new MenuItem(); history.Header = App.Text("FileHistory"); history.Click += (o, ev) => { - var viewer = new Views.Histories(repo, path); + var viewer = new FileHistories(repo, path); viewer.Show(); ev.Handled = true; }; diff --git a/src/Views/Widgets/CommitDetail.xaml.cs b/src/Views/Widgets/CommitDetail.xaml.cs index 9ebf75a9..3bf4bc8f 100644 --- a/src/Views/Widgets/CommitDetail.xaml.cs +++ b/src/Views/Widgets/CommitDetail.xaml.cs @@ -133,7 +133,7 @@ namespace SourceGit.Views.Widgets { history.Header = App.Text("FileHistory"); history.IsEnabled = change.Index != Models.Change.Status.Deleted; history.Click += (_, ev) => { - var viewer = new Views.Histories(repo, change.Path); + var viewer = new FileHistories(repo, change.Path); viewer.Show(); ev.Handled = true; }; diff --git a/src/Views/Widgets/RevisionFiles.xaml.cs b/src/Views/Widgets/RevisionFiles.xaml.cs index 103df7db..aed32501 100644 --- a/src/Views/Widgets/RevisionFiles.xaml.cs +++ b/src/Views/Widgets/RevisionFiles.xaml.cs @@ -288,7 +288,7 @@ namespace SourceGit.Views.Widgets { var history = new MenuItem(); history.Header = App.Text("FileHistory"); history.Click += (o, ev) => { - var viewer = new Views.Histories(repo, node.Path); + var viewer = new FileHistories(repo, node.Path); viewer.Show(); ev.Handled = true; }; diff --git a/src/Views/Widgets/WorkingCopyChanges.xaml.cs b/src/Views/Widgets/WorkingCopyChanges.xaml.cs index 8d15af6f..fc00046d 100644 --- a/src/Views/Widgets/WorkingCopyChanges.xaml.cs +++ b/src/Views/Widgets/WorkingCopyChanges.xaml.cs @@ -403,7 +403,7 @@ namespace SourceGit.Views.Widgets { var history = new MenuItem(); history.Header = App.Text("FileHistory"); history.Click += (o, e) => { - var viewer = new Views.Histories(repo, node.Path); + var viewer = new FileHistories(repo, node.Path); viewer.Show(); e.Handled = true; }; @@ -517,7 +517,7 @@ namespace SourceGit.Views.Widgets { var history = new MenuItem(); history.Header = App.Text("FileHistory"); history.Click += (o, e) => { - var viewer = new Views.Histories(repo, change.Path); + var viewer = new FileHistories(repo, change.Path); viewer.Show(); e.Handled = true; };