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
parent
commit
35c5960aab
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.Dialogs/Internal/ManagedFileChooserItemViewModel.cs
  2. 3
      src/Avalonia.Dialogs/Internal/ManagedFileChooserSources.cs
  3. 6
      src/Avalonia.Dialogs/Internal/ManagedFileChooserViewModel.cs

2
src/Avalonia.Dialogs/Internal/ManagedFileChooserItemViewModel.cs

@ -6,7 +6,7 @@ namespace Avalonia.Dialogs.Internal
{
private string _displayName;
private string _path;
private DateTime _modified;
private DateTime _modified;
private string _type;
private long _size;
private ManagedFileChooserItemType _itemType;

3
src/Avalonia.Dialogs/Internal/ManagedFileChooserSources.cs

@ -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,

6
src/Avalonia.Dialogs/Internal/ManagedFileChooserViewModel.cs

@ -35,12 +35,12 @@ namespace Avalonia.Dialogs.Internal
string _fileName;
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 _defaultExtension;
private bool _overwritePrompt;
private readonly bool _overwritePrompt;
private CompositeDisposable _disposables;
public string Location

Loading…
Cancel
Save