/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Data/Models/CurrentInstanceViewModel.cs
205 строк
5 KB
oxygen dioxide
Feature: Add ZIP encoding selection support for browsing archives with non-UTF-8 filenames (#18529)
05 авг 2026, 18:17
Не верифицирован
05 авг 2026, 18:17
8d5546e
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. namespace Files.App.Data.Models { public sealed partial class CurrentInstanceViewModel : ObservableObject { // TODO: // In the future, we should consolidate these public variables into // a single enum property providing simplified customization of the // values being manipulated inside the setter blocks public LayoutPreferencesManager FolderSettings { get; } public CurrentInstanceViewModel() { FolderSettings = new LayoutPreferencesManager(); } public CurrentInstanceViewModel(FolderLayoutModes rootLayoutMode) { FolderSettings = new LayoutPreferencesManager(rootLayoutMode); } private bool isPageTypeSearchResults = false; public bool IsPageTypeSearchResults { get => isPageTypeSearchResults; set { SetProperty(ref isPageTypeSearchResults, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanCopyPathInPage)); } } private string currentSearchQuery; public string CurrentSearchQuery { get => currentSearchQuery; set => SetProperty(ref currentSearchQuery, value); } private bool isPageTypeNotHome = false; public bool IsPageTypeNotHome { get => isPageTypeNotHome; set { SetProperty(ref isPageTypeNotHome, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanCopyPathInPage)); } } private bool isPageTypeReleaseNotes = false; public bool IsPageTypeReleaseNotes { get => isPageTypeReleaseNotes; set { SetProperty(ref isPageTypeReleaseNotes, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanCopyPathInPage)); } } private bool isPageTypeSettings = false; public bool IsPageTypeSettings { get => isPageTypeSettings; set { SetProperty(ref isPageTypeSettings, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanCopyPathInPage)); } } private bool isPageTypeMtpDevice = false; public bool IsPageTypeMtpDevice { get => isPageTypeMtpDevice; set { SetProperty(ref isPageTypeMtpDevice, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanCopyPathInPage)); } } private bool isPageTypeRecycleBin = false; public bool IsPageTypeRecycleBin { get => isPageTypeRecycleBin; set { SetProperty(ref isPageTypeRecycleBin, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanCopyPathInPage)); OnPropertyChanged(nameof(CanTagFilesInPage)); } } private bool isPageTypeFtp = false; public bool IsPageTypeFtp { get => isPageTypeFtp; set { SetProperty(ref isPageTypeFtp, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanTagFilesInPage)); } } private bool isPageTypeCloudDrive = false; public bool IsPageTypeCloudDrive { get => isPageTypeCloudDrive; set { SetProperty(ref isPageTypeCloudDrive, value); } } private bool isPageTypeZipFolder = false; public bool IsPageTypeZipFolder { get => isPageTypeZipFolder; set { SetProperty(ref isPageTypeZipFolder, value); OnPropertyChanged(nameof(CanCreateFileInPage)); OnPropertyChanged(nameof(CanTagFilesInPage)); } } private bool isPageTypeLibrary = false; public bool IsPageTypeLibrary { get => isPageTypeLibrary; set { SetProperty(ref isPageTypeLibrary, value); } } private string? zipEncodingName; public string? ZipEncodingName { get => zipEncodingName; set => SetProperty(ref zipEncodingName, value); } private bool isZipEncodingUndetermined; public bool IsZipEncodingUndetermined { get => isZipEncodingUndetermined; set => SetProperty(ref isZipEncodingUndetermined, value); } public bool CanCopyPathInPage { get => !isPageTypeMtpDevice && !isPageTypeRecycleBin && isPageTypeNotHome && !isPageTypeSearchResults && !IsPageTypeReleaseNotes && !IsPageTypeSettings; } public bool CanCreateFileInPage { get => !isPageTypeMtpDevice && !isPageTypeRecycleBin && isPageTypeNotHome && !isPageTypeSearchResults && !isPageTypeFtp && !isPageTypeZipFolder && !IsPageTypeReleaseNotes && !IsPageTypeSettings; } public bool CanTagFilesInPage { get => !isPageTypeRecycleBin && !isPageTypeFtp && !isPageTypeZipFolder; } private bool isGitRepository; public bool IsGitRepository { get => isGitRepository; set { SetProperty(ref isGitRepository, value); } } private string? gitRepositoryPath; public string? GitRepositoryPath { get => gitRepositoryPath; set { SetProperty(ref gitRepositoryPath, value); } } private string gitBranchName = string.Empty; public string GitBranchName { get => gitBranchName; set => SetProperty(ref gitBranchName, value); } } }