Revert "File scoped namespaces"

This reverts commit d31d8f574e.
This commit is contained in:
Burak Kaan Köse
2025-02-16 11:43:30 +01:00
parent d31d8f574e
commit cf9869b71e
617 changed files with 32097 additions and 31478 deletions

View File

@@ -4,140 +4,141 @@ using CommunityToolkit.Mvvm.ComponentModel;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
namespace Wino.Services;
public class StatePersistenceService : ObservableObject, IStatePersistanceService
namespace Wino.Services
{
public event EventHandler<string> StatePropertyChanged;
private const string OpenPaneLengthKey = nameof(OpenPaneLengthKey);
private const string MailListPaneLengthKey = nameof(MailListPaneLengthKey);
private readonly IConfigurationService _configurationService;
public StatePersistenceService(IConfigurationService configurationService)
public class StatePersistenceService : ObservableObject, IStatePersistanceService
{
_configurationService = configurationService;
public event EventHandler<string> StatePropertyChanged;
_openPaneLength = _configurationService.Get(OpenPaneLengthKey, 320d);
_mailListPaneLength = _configurationService.Get(MailListPaneLengthKey, 420d);
_calendarDisplayType = _configurationService.Get(nameof(CalendarDisplayType), CalendarDisplayType.Week);
_dayDisplayCount = _configurationService.Get(nameof(DayDisplayCount), 1);
private const string OpenPaneLengthKey = nameof(OpenPaneLengthKey);
private const string MailListPaneLengthKey = nameof(MailListPaneLengthKey);
PropertyChanged += ServicePropertyChanged;
}
private readonly IConfigurationService _configurationService;
private void ServicePropertyChanged(object sender, PropertyChangedEventArgs e) => StatePropertyChanged?.Invoke(this, e.PropertyName);
public bool IsBackButtonVisible => IsReadingMail && IsReaderNarrowed;
private bool isReadingMail;
public bool IsReadingMail
{
get => isReadingMail;
set
public StatePersistenceService(IConfigurationService configurationService)
{
if (SetProperty(ref isReadingMail, value))
_configurationService = configurationService;
_openPaneLength = _configurationService.Get(OpenPaneLengthKey, 320d);
_mailListPaneLength = _configurationService.Get(MailListPaneLengthKey, 420d);
_calendarDisplayType = _configurationService.Get(nameof(CalendarDisplayType), CalendarDisplayType.Week);
_dayDisplayCount = _configurationService.Get(nameof(DayDisplayCount), 1);
PropertyChanged += ServicePropertyChanged;
}
private void ServicePropertyChanged(object sender, PropertyChangedEventArgs e) => StatePropertyChanged?.Invoke(this, e.PropertyName);
public bool IsBackButtonVisible => IsReadingMail && IsReaderNarrowed;
private bool isReadingMail;
public bool IsReadingMail
{
get => isReadingMail;
set
{
OnPropertyChanged(nameof(IsBackButtonVisible));
if (SetProperty(ref isReadingMail, value))
{
OnPropertyChanged(nameof(IsBackButtonVisible));
}
}
}
}
private bool shouldShiftMailRenderingDesign;
private bool shouldShiftMailRenderingDesign;
public bool ShouldShiftMailRenderingDesign
{
get { return shouldShiftMailRenderingDesign; }
set { shouldShiftMailRenderingDesign = value; }
}
private bool isReaderNarrowed;
public bool IsReaderNarrowed
{
get => isReaderNarrowed;
set
public bool ShouldShiftMailRenderingDesign
{
if (SetProperty(ref isReaderNarrowed, value))
get { return shouldShiftMailRenderingDesign; }
set { shouldShiftMailRenderingDesign = value; }
}
private bool isReaderNarrowed;
public bool IsReaderNarrowed
{
get => isReaderNarrowed;
set
{
OnPropertyChanged(nameof(IsBackButtonVisible));
if (SetProperty(ref isReaderNarrowed, value))
{
OnPropertyChanged(nameof(IsBackButtonVisible));
}
}
}
}
private string coreWindowTitle;
private string coreWindowTitle;
public string CoreWindowTitle
{
get => coreWindowTitle;
set
public string CoreWindowTitle
{
if (SetProperty(ref coreWindowTitle, value))
get => coreWindowTitle;
set
{
UpdateAppCoreWindowTitle();
if (SetProperty(ref coreWindowTitle, value))
{
UpdateAppCoreWindowTitle();
}
}
}
}
private double _openPaneLength;
public double OpenPaneLength
{
get => _openPaneLength;
set
private double _openPaneLength;
public double OpenPaneLength
{
if (SetProperty(ref _openPaneLength, value))
get => _openPaneLength;
set
{
_configurationService.Set(OpenPaneLengthKey, value);
if (SetProperty(ref _openPaneLength, value))
{
_configurationService.Set(OpenPaneLengthKey, value);
}
}
}
}
private double _mailListPaneLength;
public double MailListPaneLength
{
get => _mailListPaneLength;
set
private double _mailListPaneLength;
public double MailListPaneLength
{
if (SetProperty(ref _mailListPaneLength, value))
get => _mailListPaneLength;
set
{
_configurationService.Set(MailListPaneLengthKey, value);
if (SetProperty(ref _mailListPaneLength, value))
{
_configurationService.Set(MailListPaneLengthKey, value);
}
}
}
}
private CalendarDisplayType _calendarDisplayType;
public CalendarDisplayType CalendarDisplayType
{
get => _calendarDisplayType;
set
private CalendarDisplayType _calendarDisplayType;
public CalendarDisplayType CalendarDisplayType
{
if (SetProperty(ref _calendarDisplayType, value))
get => _calendarDisplayType;
set
{
_configurationService.Set(nameof(CalendarDisplayType), value);
if (SetProperty(ref _calendarDisplayType, value))
{
_configurationService.Set(nameof(CalendarDisplayType), value);
}
}
}
}
private int _dayDisplayCount;
public int DayDisplayCount
{
get => _dayDisplayCount;
set
private int _dayDisplayCount;
public int DayDisplayCount
{
if (SetProperty(ref _dayDisplayCount, value))
get => _dayDisplayCount;
set
{
_configurationService.Set(nameof(DayDisplayCount), value);
if (SetProperty(ref _dayDisplayCount, value))
{
_configurationService.Set(nameof(DayDisplayCount), value);
}
}
}
}
private void UpdateAppCoreWindowTitle()
{
var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
private void UpdateAppCoreWindowTitle()
{
var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
if (appView != null)
appView.Title = CoreWindowTitle;
if (appView != null)
appView.Title = CoreWindowTitle;
}
}
}