Skip to content

Commit 5af016b

Browse files
authored
Cleaned up code (#886)
1 parent 768f6b7 commit 5af016b

File tree

68 files changed

+387
-573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+387
-573
lines changed

Common/Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ public static DateTime ToDateTime(this System.Runtime.InteropServices.ComTypes.F
2929
}
3030
}
3131
}
32-
}
32+
}

Common/ShellFileItem.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Runtime.Serialization;
5-
using System.Text;
6-
using System.Threading.Tasks;
72

83
namespace Files.Common
94
{
@@ -20,7 +15,6 @@ public class ShellFileItem
2015

2116
public ShellFileItem()
2217
{
23-
2418
}
2519

2620
public ShellFileItem(bool isFolder, string recyclePath, string fileName, string filePath, DateTime recycleDate, string fileSize, ulong fileSizeBytes, string fileType)
@@ -35,4 +29,4 @@ public ShellFileItem(bool isFolder, string recyclePath, string fileName, string
3529
this.FileType = fileType;
3630
}
3731
}
38-
}
32+
}

Files.Launcher/NLog.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
44

55
<targets>
6-
<target name="logfile" xsi:type="File" fileName="${var:LogPath}\debug_fulltrust.txt" concurrentWrites="true"
7-
layout="${longdate}|${level:uppercase=true}|${logger}|${message}|${exception:format=tostring}"/>
6+
<target name="logfile" xsi:type="File" fileName="${var:LogPath}\debug_fulltrust.txt" concurrentWrites="true"
7+
layout="${longdate}|${level:uppercase=true}|${logger}|${message}|${exception:format=tostring}" />
88
<target name="logconsole" xsi:type="Console" />
99
</targets>
1010

Files.Launcher/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private static bool HandleCommandLineArgs()
7979

8080
if (arguments == "ShellCommand")
8181
{
82-
// Kill the process. This is a BRUTAL WAY to kill a process.
82+
// Kill the process. This is a BRUTAL WAY to kill a process.
8383
#if DEBUG
8484
// In debug mode this kills this process too??
8585
#else
@@ -232,7 +232,7 @@ private static async void Connection_RequestReceived(AppServiceConnection sender
232232
}
233233
else if (arguments == "ShellCommand")
234234
{
235-
// Kill the process. This is a BRUTAL WAY to kill a process.
235+
// Kill the process. This is a BRUTAL WAY to kill a process.
236236
#if DEBUG
237237
// In debug mode this kills this process too??
238238
#else
@@ -313,4 +313,4 @@ private static void Connection_ServiceClosed(AppServiceConnection sender, AppSer
313313
appServiceExit.Set();
314314
}
315315
}
316-
}
316+
}

Files.Launcher/Win32API.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public enum PropertyReturnType
2626
DISPLAYVALUE
2727
}
2828

29-
public static List<(Vanara.PInvoke.Ole32.PROPERTYKEY propertyKey, PropertyReturnType returnType)> RecyledFileProperties =
29+
public static List<(Vanara.PInvoke.Ole32.PROPERTYKEY propertyKey, PropertyReturnType returnType)> RecyledFileProperties =
3030
new List<(Vanara.PInvoke.Ole32.PROPERTYKEY propertyKey, PropertyReturnType returnType)>
3131
{
3232
(Vanara.PInvoke.Ole32.PROPERTYKEY.System.Size, PropertyReturnType.RAWVALUE),
@@ -53,7 +53,7 @@ public static IList<object> GetFileProperties(ShellItem folderItem, List<(Vanara
5353
{
5454
propValueList.Add(propVariant.Value);
5555
}
56-
else if(prop.returnType == PropertyReturnType.DISPLAYVALUE)
56+
else if (prop.returnType == PropertyReturnType.DISPLAYVALUE)
5757
{
5858
using var pDesc = PropertyDescription.Create(prop.propertyKey);
5959
var pValue = pDesc?.FormatForDisplay(propVariant, Vanara.PInvoke.PropSys.PROPDESC_FORMAT_FLAGS.PDFF_DEFAULT);
@@ -69,4 +69,4 @@ public static IList<object> GetFileProperties(ShellItem folderItem, List<(Vanara
6969
return propValueList;
7070
}
7171
}
72-
}
72+
}

Files/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public static void Clipboard_ContentChanged(object sender, object e)
193193
if (App.CurrentInstance != null)
194194
{
195195
DataPackageView packageView = Clipboard.GetContent();
196-
if (packageView.Contains(StandardDataFormats.StorageItems)
196+
if (packageView.Contains(StandardDataFormats.StorageItems)
197197
&& App.CurrentInstance.CurrentPageType != typeof(YourHome)
198198
&& !App.CurrentInstance.ViewModel.WorkingDirectory.StartsWith(App.AppSettings.RecycleBinPath))
199199
{

Files/Assets/terminal/terminal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
}
2626
*/
2727
]
28-
}
28+
}

Files/BaseLayout.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
167167
App.CurrentInstance.NavigationToolbar.CanNavigateToParent = true;
168168
}
169169
App.InteractionViewModel.IsPageTypeNotHome = true; // show controls that were hidden on the home page
170-
App.InteractionViewModel.IsPageTypeNotRecycleBin =
170+
App.InteractionViewModel.IsPageTypeNotRecycleBin =
171171
!App.CurrentInstance.ViewModel.WorkingDirectory.StartsWith(App.AppSettings.RecycleBinPath);
172172

173173
await App.CurrentInstance.ViewModel.RefreshItems();
@@ -211,7 +211,7 @@ public void RightClickContextMenu_Opening(object sender, object e)
211211
}
212212
}
213213

214-
public void RightClickItemContextMenu_Opening(object sender, object e)
214+
public void RightClickItemContextMenu_Opening(object sender, object e)
215215
{
216216
var selectedFileSystemItems = App.CurrentInstance.ContentPage.SelectedItems;
217217

@@ -389,6 +389,7 @@ protected void InitializeDrag(UIElement element)
389389

390390
// VirtualKey doesn't support / accept plus and minus by default.
391391
public readonly VirtualKey plusKey = (VirtualKey)187;
392+
392393
public readonly VirtualKey minusKey = (VirtualKey)189;
393394

394395
public void GridViewSizeIncrease(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args)
@@ -421,6 +422,5 @@ public void BaseLayout_PointerWheelChanged(object sender, PointerRoutedEventArgs
421422
e.Handled = true;
422423
}
423424
}
424-
425425
}
426426
}

Files/CommandLine/CommandLineParser.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
using System.Diagnostics;
44
using System.IO;
55
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
86

97
namespace Files.CommandLine
108
{
@@ -64,7 +62,7 @@ private static ParsedCommands ParseSplitArguments(List<KeyValuePair<string, stri
6462
return commands;
6563
}
6664

67-
static string[] SplitArguments(string commandLine)
65+
private static string[] SplitArguments(string commandLine)
6866
{
6967
char[] commandLineCharArray = commandLine.ToCharArray();
7068
bool isInQuote = false;
@@ -89,7 +87,7 @@ public static List<KeyValuePair<string, string>> Parse(string[] args = null)
8987
if (args != null)
9088
{
9189
//if - or / are not used then add the command as-is
92-
90+
9391
if (args.Length > 2)
9492
{
9593
for (int i = 0; i < args.Length; i++)

Files/CommandLine/ParsedCommand.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace Files.CommandLine
1+
namespace Files.CommandLine
82
{
93
internal class ParsedCommand
104
{

0 commit comments

Comments
 (0)