Skip to content

Commit ca98008

Browse files
authored
Codebase: Remove unnecessary this keyword (#11037)
1 parent bca8fd1 commit ca98008

File tree

82 files changed

+245
-245
lines changed

Some content is hidden

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

82 files changed

+245
-245
lines changed

src/Files.App.Storage/WindowsStorage/WindowsStorable.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public abstract class WindowsStorable<TStorage> : ILocatableStorable
2424
protected internal WindowsStorable(TStorage storage)
2525
{
2626
this.storage = storage;
27-
this.Path = storage.Path;
28-
this.Name = storage.Name;
29-
this.Id = string.Empty;
27+
Path = storage.Path;
28+
Name = storage.Name;
29+
Id = string.Empty;
3030
}
3131

3232
/// <inheritdoc/>

src/Files.App/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public App()
8989
UnhandledException += OnUnhandledException;
9090
TaskScheduler.UnobservedTaskException += OnUnobservedException;
9191
InitializeComponent();
92-
this.Services = ConfigureServices();
92+
Services = ConfigureServices();
9393
Ioc.Default.ConfigureServices(Services);
9494
}
9595

src/Files.App/BaseLayout.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
371371
{
372372
base.OnNavigatedTo(eventArgs);
373373
// Add item jumping handler
374-
this.CharacterReceived += Page_CharacterReceived;
374+
CharacterReceived += Page_CharacterReceived;
375375
navigationArguments = (NavigationArguments)eventArgs.Parameter;
376376
ParentShellPageInstance = navigationArguments.AssociatedTabInstance;
377377
InitializeCommandsViewModel();
@@ -491,7 +491,7 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
491491
{
492492
base.OnNavigatingFrom(e);
493493
// Remove item jumping handler
494-
this.CharacterReceived -= Page_CharacterReceived;
494+
CharacterReceived -= Page_CharacterReceived;
495495
FolderSettings!.LayoutModeChangeRequested -= BaseFolderSettings_LayoutModeChangeRequested;
496496
FolderSettings.GroupOptionPreferenceUpdated -= FolderSettings_GroupOptionPreferenceUpdated;
497497
ItemContextMenuFlyout.Opening -= ItemContextFlyout_Opening;
@@ -578,7 +578,7 @@ private async Task LoadMenuItemsAsync()
578578
itc.MaxHeight = Constants.UI.ContextMenuMaxHeight; // Reset menu max height
579579
shellContextMenuItemCancellationToken?.Cancel();
580580
shellContextMenuItemCancellationToken = new CancellationTokenSource();
581-
SelectedItemsPropertiesViewModel.CheckAllFileExtensions(this.SelectedItems!.Select(selectedItem => selectedItem?.FileExtension).ToList()!);
581+
SelectedItemsPropertiesViewModel.CheckAllFileExtensions(SelectedItems!.Select(selectedItem => selectedItem?.FileExtension).ToList()!);
582582
var shiftPressed = Microsoft.UI.Input.InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Shift).HasFlag(Windows.UI.Core.CoreVirtualKeyStates.Down);
583583
var items = ContextFlyoutItemHelper.GetItemContextCommandsWithoutShellItems(currentInstanceViewModel: InstanceViewModel!, workingDir: ParentShellPageInstance!.FilesystemViewModel.WorkingDirectory, selectedItems: SelectedItems!, selectedItemsPropertiesViewModel: SelectedItemsPropertiesViewModel, commandsViewModel: CommandsViewModel!, shiftPressed: shiftPressed, showOpenMenu: false);
584584
ItemContextMenuFlyout.PrimaryCommands.Clear();

src/Files.App/DataModels/SuggestionModel.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ private void Img_ImageOpened(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
6060

6161
public SuggestionModel(ListedItem item)
6262
{
63-
this.LoadFileIcon = item.LoadFileIcon;
64-
this.NeedsPlaceholderGlyph = item.NeedsPlaceholderGlyph;
65-
this.ItemPath = item.ItemPath;
66-
this.Name = item.Name;
67-
this.FileImage = item.FileImage;
63+
LoadFileIcon = item.LoadFileIcon;
64+
NeedsPlaceholderGlyph = item.NeedsPlaceholderGlyph;
65+
ItemPath = item.ItemPath;
66+
Name = item.Name;
67+
FileImage = item.FileImage;
6868
}
6969

7070
public SuggestionModel(string itemName, bool isRecentSearch)
7171
{
72-
this.IsRecentSearch = isRecentSearch;
73-
this.Name = itemName;
72+
IsRecentSearch = isRecentSearch;
73+
Name = itemName;
7474
}
7575
}
7676
}

src/Files.App/Dialogs/AddItemDialog.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public AddItemDialog()
2929
private void ListView_ItemClick(object sender, ItemClickEventArgs e)
3030
{
3131
ViewModel.ResultType = (e.ClickedItem as AddItemDialogListItemViewModel).ItemResult;
32-
this.Hide();
32+
Hide();
3333
}
3434

3535
private async void AddItemDialog_Loaded(object sender, RoutedEventArgs e)

src/Files.App/Dialogs/CreateShortcutDialog.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public CreateShortcutDialogViewModel ViewModel
1818

1919
public CreateShortcutDialog()
2020
{
21-
this.InitializeComponent();
21+
InitializeComponent();
2222
}
2323

2424
public new async Task<DialogResult> ShowAsync() => (DialogResult)await base.ShowAsync();

src/Files.App/Dialogs/CredentialDialog.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public CredentialDialogViewModel ViewModel
2020

2121
public CredentialDialog()
2222
{
23-
this.InitializeComponent();
23+
InitializeComponent();
2424
}
2525

2626
public new async Task<DialogResult> ShowAsync() => (DialogResult)await base.ShowAsync();

src/Files.App/Dialogs/DecompressArchiveDialog.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public DecompressArchiveDialogViewModel ViewModel
1717

1818
public DecompressArchiveDialog()
1919
{
20-
this.InitializeComponent();
20+
InitializeComponent();
2121
}
2222

2323
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)

src/Files.App/Dialogs/DynamicDialog.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ private ContentDialog SetContentDialogRoot(ContentDialog contentDialog)
3535

3636
public DynamicDialog(DynamicDialogViewModel dynamicDialogViewModel)
3737
{
38-
this.InitializeComponent();
38+
InitializeComponent();
3939

40-
dynamicDialogViewModel.HideDialog = this.Hide;
41-
this.ViewModel = dynamicDialogViewModel;
40+
dynamicDialogViewModel.HideDialog = Hide;
41+
ViewModel = dynamicDialogViewModel;
4242
}
4343

4444
#region IDisposable

src/Files.App/Dialogs/ElevateConfirmDialog.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public ElevateConfirmDialogViewModel ViewModel
1818

1919
public ElevateConfirmDialog()
2020
{
21-
this.InitializeComponent();
21+
InitializeComponent();
2222
}
2323

2424
public new async Task<DialogResult> ShowAsync() => (DialogResult)await base.ShowAsync();

0 commit comments

Comments
 (0)