Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJoeFin committed Sep 19, 2024
1 parent 8e7ee43 commit c66ee8b
Show file tree
Hide file tree
Showing 58 changed files with 424 additions and 438 deletions.
4 changes: 2 additions & 2 deletions Text-Grab/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public partial class App : System.Windows.Application
{
#region Fields

readonly static Settings _defaultSettings = AppUtilities.TextGrabSettings;
private static readonly Settings _defaultSettings = AppUtilities.TextGrabSettings;

#endregion Fields

Expand Down Expand Up @@ -232,7 +232,7 @@ private void appExit(object sender, ExitEventArgs e)
Singleton<HistoryService>.Instance.WriteHistory();
}

async void appStartup(object sender, StartupEventArgs e)
private async void appStartup(object sender, StartupEventArgs e)
{
NumberOfRunningInstances = Process.GetProcessesByName("Text-Grab").Length;
Current.DispatcherUnhandledException += CurrentDispatcherUnhandledException;
Expand Down
1 change: 0 additions & 1 deletion Text-Grab/Controls/AddOrRemoveWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Windows.Graphics.Printing.Workflow;

namespace Text_Grab.Controls;

Expand Down
1 change: 0 additions & 1 deletion Text-Grab/Controls/CollapsibleButton.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using Text_Grab.Models;
using Wpf.Ui.Controls;

Expand Down
7 changes: 3 additions & 4 deletions Text-Grab/Controls/FindAndReplaceWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
Expand All @@ -28,7 +27,7 @@ public partial class FindAndReplaceWindow : FluentWindow
public static RoutedCommand ReplaceAllCmd = new();
public static RoutedCommand ReplaceOneCmd = new();
public static RoutedCommand TextSearchCmd = new();
DispatcherTimer ChangeFindTextTimer = new();
private DispatcherTimer ChangeFindTextTimer = new();
private MatchCollection? Matches;
private string stringFromWindow = "";
private EditTextWindow? textEditWindow;
Expand Down Expand Up @@ -171,11 +170,11 @@ private void CopyMatchesCmd_Executed(object sender, ExecutedRoutedEventArgs e)

StringBuilder stringBuilder = new();

var selection = ResultsListView.SelectedItems;
IList selection = ResultsListView.SelectedItems;
if (selection.Count < 2)
selection = ResultsListView.Items;

foreach (var item in selection)
foreach (object? item in selection)
if (item is FindResult findResult)
stringBuilder.AppendLine(findResult.Text);

Expand Down
2 changes: 1 addition & 1 deletion Text-Grab/Controls/PreviousGrabWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public PreviousGrabWindow(Rect rect)
Left = rect.Left - borderThickness;
Top = rect.Top - borderThickness;

DispatcherTimer timer = new DispatcherTimer();
DispatcherTimer timer = new();
timer.Interval = TimeSpan.FromMilliseconds(500);
timer.Tick += (s, e) => { timer.Stop(); Close(); };
timer.Start();
Expand Down
Loading

0 comments on commit c66ee8b

Please sign in to comment.