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

@@ -1,15 +1,16 @@
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Models.Reader;
public class FilterOption
namespace Wino.Core.Domain.Models.Reader
{
public FilterOptionType Type { get; set; }
public string Title { get; set; }
public FilterOption(string title, FilterOptionType type)
public class FilterOption
{
Title = title;
Type = type;
public FilterOptionType Type { get; set; }
public string Title { get; set; }
public FilterOption(string title, FilterOptionType type)
{
Title = title;
Type = type;
}
}
}

View File

@@ -1,31 +1,32 @@
using System.Collections.Generic;
using MimeKit;
namespace Wino.Core.Domain.Models.Reader;
/// <summary>
/// Final model to be passed to renderer page.
/// Data here are created based on rendering settings.
/// </summary>
public class MailRenderModel
namespace Wino.Core.Domain.Models.Reader
{
public string RenderHtml { get; }
public MailRenderingOptions MailRenderingOptions { get; }
public List<MimePart> Attachments { get; set; } = [];
public UnsubscribeInfo UnsubscribeInfo { get; set; }
public MailRenderModel(string renderHtml, MailRenderingOptions mailRenderingOptions = null)
/// <summary>
/// Final model to be passed to renderer page.
/// Data here are created based on rendering settings.
/// </summary>
public class MailRenderModel
{
RenderHtml = renderHtml;
MailRenderingOptions = mailRenderingOptions;
public string RenderHtml { get; }
public MailRenderingOptions MailRenderingOptions { get; }
public List<MimePart> Attachments { get; set; } = [];
public UnsubscribeInfo UnsubscribeInfo { get; set; }
public MailRenderModel(string renderHtml, MailRenderingOptions mailRenderingOptions = null)
{
RenderHtml = renderHtml;
MailRenderingOptions = mailRenderingOptions;
}
}
public class UnsubscribeInfo
{
public string HttpLink { get; set; }
public string MailToLink { get; set; }
public bool IsOneClick { get; set; }
public bool CanUnsubscribe => HttpLink != null || MailToLink != null;
}
}
public class UnsubscribeInfo
{
public string HttpLink { get; set; }
public string MailToLink { get; set; }
public bool IsOneClick { get; set; }
public bool CanUnsubscribe => HttpLink != null || MailToLink != null;
}

View File

@@ -1,20 +1,21 @@
namespace Wino.Core.Domain.Models.Reader;
/// <summary>
/// Rendering options for mail.
/// </summary>
public class MailRenderingOptions
namespace Wino.Core.Domain.Models.Reader
{
private const bool DefaultLoadImageValue = true;
private const bool DefaultLoadStylesValue = true;
private const bool DefaultRenderPlaintextLinksValue = true;
/// <summary>
/// Rendering options for mail.
/// </summary>
public class MailRenderingOptions
{
private const bool DefaultLoadImageValue = true;
private const bool DefaultLoadStylesValue = true;
private const bool DefaultRenderPlaintextLinksValue = true;
public bool LoadImages { get; set; } = DefaultLoadImageValue;
public bool LoadStyles { get; set; } = DefaultLoadStylesValue;
public bool RenderPlaintextLinks { get; set; } = DefaultRenderPlaintextLinksValue;
public bool LoadImages { get; set; } = DefaultLoadImageValue;
public bool LoadStyles { get; set; } = DefaultLoadStylesValue;
public bool RenderPlaintextLinks { get; set; } = DefaultRenderPlaintextLinksValue;
// HtmlDocument.Load call is redundant if all the settings are in default values.
// Therefore we will purify the HTML only if needed.
// HtmlDocument.Load call is redundant if all the settings are in default values.
// Therefore we will purify the HTML only if needed.
public bool IsPurifyingNeeded() => LoadImages != DefaultLoadImageValue || LoadStyles != DefaultLoadStylesValue;
public bool IsPurifyingNeeded() => LoadImages != DefaultLoadImageValue || LoadStyles != DefaultLoadStylesValue;
}
}

View File

@@ -3,26 +3,27 @@ using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Comparers;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Models.Reader;
public class SortingOption
namespace Wino.Core.Domain.Models.Reader
{
public SortingOptionType Type { get; set; }
public string Title { get; set; }
public IComparer<IMailItem> Comparer
public class SortingOption
{
get
public SortingOptionType Type { get; set; }
public string Title { get; set; }
public IComparer<IMailItem> Comparer
{
if (Type == SortingOptionType.ReceiveDate)
return new DateComparer();
else
return new NameComparer();
get
{
if (Type == SortingOptionType.ReceiveDate)
return new DateComparer();
else
return new NameComparer();
}
}
public SortingOption(string title, SortingOptionType type)
{
Title = title;
Type = type;
}
}
public SortingOption(string title, SortingOptionType type)
{
Title = title;
Type = type;
}
}

View File

@@ -1,15 +1,16 @@
using System.Text.Json.Serialization;
namespace Wino.Core.Domain.Models.Reader;
/// <summary>
/// Used to pass messages from the webview to the app.
/// </summary>
public class WebViewMessage
namespace Wino.Core.Domain.Models.Reader
{
[JsonPropertyName("type")]
public string Type { get; set; }
/// <summary>
/// Used to pass messages from the webview to the app.
/// </summary>
public class WebViewMessage
{
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("value")]
public string Value { get; set; }
[JsonPropertyName("value")]
public string Value { get; set; }
}
}