Browse Source
In `Avalonia.Dialogs`, added `readonly` to fields that are never modi… (#13022 )
* In `Avalonia.Dialogs`, added `readonly` to fields that are never modified
* Re-added namespace references
* Removed `readonly` modifier from field which is used as a `ref` value
* Removed `readonly` from yet another field
---------
Co-authored-by: Lehonti Ramos <lehonti@ramos>
pull/13069/head
Lehonti Ramos
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
5 deletions
src/Avalonia.Dialogs/Internal/ManagedFileChooserItemViewModel.cs
src/Avalonia.Dialogs/Internal/ManagedFileChooserSources.cs
src/Avalonia.Dialogs/Internal/ManagedFileChooserViewModel.cs
@ -6,7 +6,7 @@ namespace Avalonia.Dialogs.Internal
{
private string _d isplayName ;
private string _ path ;
private DateTime _ modified ;
private DateTime _ modified ;
private string _ type ;
private long _ size ;
private ManagedFileChooserItemType _ itemType ;
@ -5,6 +5,7 @@ using System.Linq;
using Avalonia.Controls.Platform ;
using Avalonia.Utilities ;
namespace Avalonia.Dialogs.Internal
{
internal class ManagedFileChooserSources
@ -26,7 +27,7 @@ namespace Avalonia.Dialogs.Internal
return sources . GetUserDirectories ( ) . Concat ( sources . GetFileSystemRoots ( ) ) . ToArray ( ) ;
}
private static Environment . SpecialFolder [ ] s_folders = new [ ]
private static readonly Environment . SpecialFolder [ ] s_folders = new [ ]
{
Environment . SpecialFolder . Desktop ,
Environment . SpecialFolder . UserProfile ,
@ -35,12 +35,12 @@ namespace Avalonia.Dialogs.Internal
string _f ileName ;
private bool _ showHiddenFiles ;
private ManagedFileChooserFilterViewModel _ selectedFilter ;
private bool _ selectingDirectory ;
private bool _ savingFile ;
private readonly bool _ selectingDirectory ;
private readonly bool _ savingFile ;
private bool _ scheduledSelectionValidation ;
private bool _ alreadyCancelled = false ;
private string _d efaultExtension ;
private bool _ overwritePrompt ;
private readonly bool _ overwritePrompt ;
private CompositeDisposable _d isposables ;
public string Location