mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-30 08:34:59 +00:00
cleanup<*>: run vs code cleanup to format codestyle and remove unused references
This commit is contained in:
parent
37559b60d4
commit
2cf7192ec4
41 changed files with 77 additions and 89 deletions
|
@ -41,9 +41,9 @@ namespace SourceGit.Views.Controls {
|
|||
/// 邮件属性定义
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty EmailProperty = DependencyProperty.Register(
|
||||
"Email",
|
||||
"Email",
|
||||
typeof(string),
|
||||
typeof(Avatar),
|
||||
typeof(Avatar),
|
||||
new PropertyMetadata(null, OnEmailChanged));
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace SourceGit.Views.Controls {
|
||||
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
@ -67,7 +62,7 @@ namespace SourceGit.Views.Controls {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!mark.IsNewPage) {
|
||||
if (!mark.IsNewPage) {
|
||||
if (mark.Color == 0) {
|
||||
mark.icon.SetResourceReference(Path.FillProperty, "Brush.FG1");
|
||||
mark.icon.Data = mark.FindResource("Icon.Git") as Geometry;
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace SourceGit.Views.Controls {
|
|||
class ChangeStatusIcon : FrameworkElement {
|
||||
|
||||
public static readonly DependencyProperty ChangeProperty = DependencyProperty.Register(
|
||||
"Change",
|
||||
typeof(Models.Change),
|
||||
typeof(ChangeStatusIcon),
|
||||
"Change",
|
||||
typeof(Models.Change),
|
||||
typeof(ChangeStatusIcon),
|
||||
new PropertyMetadata(null, ForceDirty));
|
||||
|
||||
public Models.Change Change {
|
||||
|
@ -21,9 +21,9 @@ namespace SourceGit.Views.Controls {
|
|||
}
|
||||
|
||||
public static readonly DependencyProperty IsLocalChangeProperty = DependencyProperty.Register(
|
||||
"IsLocalChange",
|
||||
typeof(bool),
|
||||
typeof(ChangeStatusIcon),
|
||||
"IsLocalChange",
|
||||
typeof(bool),
|
||||
typeof(ChangeStatusIcon),
|
||||
new PropertyMetadata(false, ForceDirty));
|
||||
|
||||
public bool IsLocalChange {
|
||||
|
@ -76,7 +76,7 @@ namespace SourceGit.Views.Controls {
|
|||
FlowDirection.LeftToRight,
|
||||
new Typeface(new FontFamily("Microsoft YaHei UI"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
|
||||
icon.Width * 0.8,
|
||||
new SolidColorBrush(Color.FromRgb(241,241,241)),
|
||||
new SolidColorBrush(Color.FromRgb(241, 241, 241)),
|
||||
VisualTreeHelper.GetDpi(icon).PixelsPerDip);
|
||||
|
||||
icon.InvalidateVisual();
|
||||
|
|
|
@ -269,7 +269,7 @@ namespace SourceGit.Views.Controls {
|
|||
dc.DrawEllipse(dotFill, PENS[dot.Color], dot.Center, 3, 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void DrawCurves(DrawingContext dc, double top, double bottom) {
|
||||
foreach (var line in data.Paths) {
|
||||
var last = line.Points[0];
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace SourceGit.Views.Controls {
|
|||
if (result != IntPtr.Zero) {
|
||||
IntPtr pathPtr = Marshal.AllocHGlobal(260 * Marshal.SystemDefaultCharSize);
|
||||
Shell32.SHGetPathFromIDList(result, pathPtr);
|
||||
|
||||
|
||||
if (pathPtr != IntPtr.Zero) {
|
||||
SelectedPath = Marshal.PtrToStringAuto(pathPtr);
|
||||
ok = true;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace SourceGit.Views.Controls {
|
||||
/// <summary>
|
||||
|
@ -15,9 +15,9 @@ namespace SourceGit.Views.Controls {
|
|||
private static readonly Brush HL_DELETED = new SolidColorBrush(Color.FromArgb(128, 255, 0, 0));
|
||||
|
||||
public static readonly DependencyProperty DataProperty = DependencyProperty.Register(
|
||||
"Data",
|
||||
"Data",
|
||||
typeof(Models.TextChanges.Line),
|
||||
typeof(HighlightableTextBlock),
|
||||
typeof(HighlightableTextBlock),
|
||||
new PropertyMetadata(null, OnContentChanged));
|
||||
|
||||
public Models.TextChanges.Line Data {
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace SourceGit.Views.Controls {
|
|||
public class IconButton : Button {
|
||||
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
|
||||
"Icon",
|
||||
typeof(Geometry),
|
||||
typeof(IconButton),
|
||||
"Icon",
|
||||
typeof(Geometry),
|
||||
typeof(IconButton),
|
||||
new PropertyMetadata(null));
|
||||
|
||||
public Geometry Icon {
|
||||
|
@ -21,9 +21,9 @@ namespace SourceGit.Views.Controls {
|
|||
}
|
||||
|
||||
public static readonly DependencyProperty HoverBackgroundProperty = DependencyProperty.Register(
|
||||
"HoverBackground",
|
||||
typeof(Brush),
|
||||
typeof(IconButton),
|
||||
"HoverBackground",
|
||||
typeof(Brush),
|
||||
typeof(IconButton),
|
||||
new PropertyMetadata(Brushes.Transparent));
|
||||
|
||||
public Brush HoverBackground {
|
||||
|
|
|
@ -14,9 +14,9 @@ namespace SourceGit.Views.Controls {
|
|||
private Path icon = null;
|
||||
|
||||
public static readonly DependencyProperty IsAnimatingProperty = DependencyProperty.Register(
|
||||
"IsAnimating",
|
||||
typeof(bool),
|
||||
typeof(Loading),
|
||||
"IsAnimating",
|
||||
typeof(bool),
|
||||
typeof(Loading),
|
||||
new PropertyMetadata(false, OnIsAnimatingChanged));
|
||||
|
||||
public bool IsAnimating {
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace SourceGit.Views.Controls {
|
|||
|
||||
public static readonly DependencyProperty PlaceholderProperty = DependencyProperty.Register(
|
||||
"Placeholder",
|
||||
typeof(string),
|
||||
typeof(string),
|
||||
typeof(TextEdit),
|
||||
new PropertyMetadata(""));
|
||||
|
||||
|
@ -24,9 +24,9 @@ namespace SourceGit.Views.Controls {
|
|||
}
|
||||
|
||||
public static readonly DependencyProperty PlaceholderBaselineProperty = DependencyProperty.Register(
|
||||
"PlaceholderBaseline",
|
||||
typeof(AlignmentY),
|
||||
typeof(TextEdit),
|
||||
"PlaceholderBaseline",
|
||||
typeof(AlignmentY),
|
||||
typeof(TextEdit),
|
||||
new PropertyMetadata(AlignmentY.Center));
|
||||
|
||||
public AlignmentY PlaceholderBaseline {
|
||||
|
|
|
@ -13,9 +13,9 @@ namespace SourceGit.Views.Controls {
|
|||
/// </summary>
|
||||
public class Tree : TreeView {
|
||||
public static readonly DependencyProperty MultiSelectionProperty = DependencyProperty.Register(
|
||||
"MultiSelection",
|
||||
typeof(bool),
|
||||
typeof(Tree),
|
||||
"MultiSelection",
|
||||
typeof(bool),
|
||||
typeof(Tree),
|
||||
new PropertyMetadata(false));
|
||||
|
||||
public bool MultiSelection {
|
||||
|
@ -90,7 +90,7 @@ namespace SourceGit.Views.Controls {
|
|||
|
||||
protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue) {
|
||||
base.OnItemsSourceChanged(oldValue, newValue);
|
||||
|
||||
|
||||
if (Selected.Count > 0) {
|
||||
Selected.Clear();
|
||||
RaiseEvent(new RoutedEventArgs(SelectionChangedEvent));
|
||||
|
|
|
@ -9,9 +9,9 @@ namespace SourceGit.Views.Controls {
|
|||
public class TreeItem : TreeViewItem {
|
||||
|
||||
public static readonly DependencyProperty IsCheckedProperty = DependencyProperty.Register(
|
||||
"IsChecked",
|
||||
typeof(bool),
|
||||
typeof(TreeItem),
|
||||
"IsChecked",
|
||||
typeof(bool),
|
||||
typeof(TreeItem),
|
||||
new PropertyMetadata(false));
|
||||
|
||||
public bool IsChecked {
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace SourceGit.Views.Popups {
|
|||
/// 应用补丁
|
||||
/// </summary>
|
||||
public partial class Apply : Controls.PopupWidget {
|
||||
private string repo = null;
|
||||
private string repo = null;
|
||||
public string File { get; set; }
|
||||
|
||||
public Apply(string repo) {
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace SourceGit.Views.Popups {
|
|||
/// </summary>
|
||||
public partial class Fetch : Controls.PopupWidget {
|
||||
private string repo = null;
|
||||
|
||||
|
||||
public Fetch(Models.Repository repo, string preferRemote) {
|
||||
this.repo = repo.Path;
|
||||
InitializeComponent();
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace SourceGit.Views.Popups {
|
|||
name = branch.Substring(repo.GitFlow.Feature.Length);
|
||||
break;
|
||||
case Models.GitFlowBranchType.Release:
|
||||
txtPrefix.Text = App.Text("GitFlow.Release");
|
||||
txtPrefix.Text = App.Text("GitFlow.Release");
|
||||
name = branch.Substring(repo.GitFlow.Release.Length);
|
||||
break;
|
||||
case Models.GitFlowBranchType.Hotfix:
|
||||
|
|
|
@ -39,11 +39,11 @@ namespace SourceGit.Views.Popups {
|
|||
return Task.Run(() => {
|
||||
Models.Watcher.SetEnabled(repo.Path, false);
|
||||
var succ = new Commands.Push(
|
||||
repo.Path,
|
||||
localBranch.Name,
|
||||
remoteBranch.Remote,
|
||||
remoteBranch.Name.Replace(" (new)", ""),
|
||||
withTags,
|
||||
repo.Path,
|
||||
localBranch.Name,
|
||||
remoteBranch.Remote,
|
||||
remoteBranch.Name.Replace(" (new)", ""),
|
||||
withTags,
|
||||
force,
|
||||
track,
|
||||
UpdateProgress).Exec();
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SourceGit.Views.Popups {
|
||||
|
|
|
@ -5,8 +5,8 @@ using System.Windows.Controls;
|
|||
namespace SourceGit.Views.Validations {
|
||||
public class CloneDir : ValidationRule {
|
||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
||||
return Directory.Exists(value as string)
|
||||
? ValidationResult.ValidResult
|
||||
return Directory.Exists(value as string)
|
||||
? ValidationResult.ValidResult
|
||||
: new ValidationResult(false, App.Text("BadCloneFolder"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ namespace SourceGit.Views.Validations {
|
|||
public class CommitMessage : ValidationRule {
|
||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
||||
var subject = value as string;
|
||||
return string.IsNullOrWhiteSpace(subject)
|
||||
? new ValidationResult(false, App.Text("EmptyCommitMessage"))
|
||||
return string.IsNullOrWhiteSpace(subject)
|
||||
? new ValidationResult(false, App.Text("EmptyCommitMessage"))
|
||||
: ValidationResult.ValidResult;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ namespace SourceGit.Views.Validations {
|
|||
public class Required : ValidationRule {
|
||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
||||
var path = value as string;
|
||||
return string.IsNullOrEmpty(path) ?
|
||||
new ValidationResult(false, App.Text("Required")) :
|
||||
return string.IsNullOrEmpty(path) ?
|
||||
new ValidationResult(false, App.Text("Required")) :
|
||||
ValidationResult.ValidResult;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -337,7 +337,7 @@ namespace SourceGit.Views.Widgets {
|
|||
var row = sender as DataGridRow;
|
||||
if (row == null) return;
|
||||
|
||||
var change = row.Item as Models.Change;
|
||||
var change = row.Item as Models.Change;
|
||||
if (change == null) return;
|
||||
|
||||
OpenChangeContextMenu(change);
|
||||
|
|
|
@ -454,7 +454,7 @@ namespace SourceGit.Views.Widgets {
|
|||
|
||||
private void OpenNewBranch(object sender, RoutedEventArgs e) {
|
||||
var current = repo.Branches.Find(x => x.IsCurrent);
|
||||
if (current != null) {
|
||||
if (current != null) {
|
||||
new Popups.CreateBranch(repo, current).Show();
|
||||
} else {
|
||||
Models.Exception.Raise(App.Text("CreateBranch.Idle"));
|
||||
|
@ -815,7 +815,7 @@ namespace SourceGit.Views.Widgets {
|
|||
Clipboard.SetText(branch.Remote + "/" + branch.Name);
|
||||
e.Handled = true;
|
||||
};
|
||||
|
||||
|
||||
menu.Items.Add(delete);
|
||||
menu.Items.Add(new Separator());
|
||||
menu.Items.Add(createBranch);
|
||||
|
|
|
@ -170,7 +170,7 @@ namespace SourceGit.Views.Widgets {
|
|||
if (dummy != seq) return;
|
||||
|
||||
loading.Visibility = Visibility.Collapsed;
|
||||
mask.Visibility = Visibility.Collapsed;
|
||||
mask.Visibility = Visibility.Collapsed;
|
||||
toolbarOptions.Visibility = Visibility.Collapsed;
|
||||
noChange.Visibility = Visibility.Visible;
|
||||
});
|
||||
|
@ -226,7 +226,7 @@ namespace SourceGit.Views.Widgets {
|
|||
}
|
||||
|
||||
foreach (var s in splitters) s.Visibility = Visibility.Visible;
|
||||
|
||||
|
||||
editor.Columns[0].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel);
|
||||
editor.Columns[1].Width = new DataGridLength(lineNumberWidth, DataGridLengthUnitType.Pixel);
|
||||
editor.Columns[2].MinWidth = minWidth;
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace SourceGit.Views.Widgets {
|
|||
mask.Visibility = Visibility.Visible;
|
||||
txtCounter.Text = App.Text("Histories.Selected", selected.Count);
|
||||
} else {
|
||||
mask.Visibility = Visibility.Visible;
|
||||
mask.Visibility = Visibility.Visible;
|
||||
txtCounter.Text = App.Text("Histories.Guide");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace SourceGit.Views.Widgets {
|
|||
public void ShowAndStart(Controls.PopupWidget widget) {
|
||||
if (locked) return;
|
||||
Show(widget);
|
||||
Sure(null, null);
|
||||
Sure(null, null);
|
||||
}
|
||||
|
||||
public void UpdateProgress(string message) {
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace SourceGit.Views.Widgets {
|
|||
}
|
||||
|
||||
private void OnTreeDragOver(object sender, DragEventArgs e) {
|
||||
if (!e.Data.GetDataPresent(DataFormats.FileDrop) && !e.Data.GetDataPresent(typeof(Node))) return;
|
||||
if (!e.Data.GetDataPresent(DataFormats.FileDrop) && !e.Data.GetDataPresent(typeof(Node))) return;
|
||||
|
||||
var item = tree.FindItem(e.OriginalSource as DependencyObject);
|
||||
if (item == null) return;
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace SourceGit.Views.Widgets {
|
|||
List<Models.Change> stagedChanges = new List<Models.Change>();
|
||||
|
||||
foreach (var c in changes) {
|
||||
if (c.Index == Models.Change.Status.Modified
|
||||
if (c.Index == Models.Change.Status.Modified
|
||||
|| c.Index == Models.Change.Status.Added
|
||||
|| c.Index == Models.Change.Status.Deleted
|
||||
|| c.Index == Models.Change.Status.Renamed) {
|
||||
|
|
|
@ -344,7 +344,7 @@ namespace SourceGit.Views.Widgets {
|
|||
explore.IsEnabled = File.Exists(path) || Directory.Exists(path);
|
||||
explore.Header = App.Text("RevealFile");
|
||||
explore.Click += (o, e) => {
|
||||
if (node.IsFolder) Process.Start("explorer", path);
|
||||
if (node.IsFolder) Process.Start("explorer", path);
|
||||
else Process.Start("explorer", $"/select,{path}");
|
||||
e.Handled = true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue