Initial commit.

This commit is contained in:
Burak Kaan Köse
2024-04-18 01:44:37 +02:00
parent 524ea4c0e1
commit 12d3814626
671 changed files with 77295 additions and 0 deletions

290
.editorconfig Normal file
View File

@@ -0,0 +1,290 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
[*]
trim_trailing_whitespace = true
insert_final_newline = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_readonly_field = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
dotnet_code_quality_unused_parameters = all:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_event = false:silent
dotnet_style_qualification_for_method = false:silent
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
# New line preferences
end_of_line = crlf
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# Types: use keywords instead of BCL types, and permit var only when the type is clear
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:none
csharp_style_var_elsewhere = false:suggestion
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# Expression-level preferences
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true
# Field preferences
dotnet_style_readonly_field = true
# Parameter preferences
dotnet_code_quality_unused_parameters = all
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = none
# New line preferences
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent
# Expression-bodied members
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_switch_expression = true:suggestion
# Null-checking preferences
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
# Code-block preferences
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:silent
# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true:none
csharp_preserve_single_line_statements = true:none
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_or_internal_field_should_be__fieldname.severity = suggestion
dotnet_naming_rule.private_or_internal_field_should_be__fieldname.symbols = private_or_internal_field
dotnet_naming_rule.private_or_internal_field_should_be__fieldname.style = _fieldname
# name all constant fields using PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_style._fieldname.required_prefix = _
dotnet_naming_style._fieldname.required_suffix =
dotnet_naming_style._fieldname.word_separator =
dotnet_naming_style._fieldname.capitalization = camel_case
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

404
.gitignore vendored Normal file
View File

@@ -0,0 +1,404 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Nuget personal access tokens and Credentials
nuget.config
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
.idea/
*.sln.iml
.vs/Wino/v16/.suo
.vs/Wino/v16/.suo
*.v2
Wino/obj/x86/Debug/App.g.cs
Wino/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Wino/obj/x86/Debug/XamlSaveStateFile.xml
.vs/Wino/v16/.suo
.vs/Wino/DesignTimeBuild/.dtbcache.v2
.vs/Wino/v16/.suo
*.v2
Wino/obj/x86/Debug/XamlSaveStateFile.xml
Wino/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Wino/obj/x86/Debug/XamlSaveStateFile.xml
Wino/obj/x86/Debug/XamlSaveStateFile.xml
*.cache
.vs/Wino/v16/.suo

View File

@@ -0,0 +1,34 @@
using Microsoft.Toolkit.Uwp.Notifications;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Background;
using Wino.Core.Domain;
namespace Wino.BackgroundTasks
{
/// <summary>
/// Creates a toast notification to notify user when the Store update happens.
/// </summary>
public sealed class AppUpdatedTask : IBackgroundTask
{
public void Run(IBackgroundTaskInstance taskInstance)
{
var def = taskInstance.GetDeferral();
var builder = new ToastContentBuilder();
builder.SetToastScenario(ToastScenario.Default);
Package package = Package.Current;
PackageId packageId = package.Id;
PackageVersion version = packageId.Version;
var versionText = string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision);
builder.AddText(Translator.Notifications_WinoUpdatedTitle);
builder.AddText(string.Format(Translator.Notifications_WinoUpdatedMessage, versionText));
builder.Show();
def.Complete();
}
}
}

View File

@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Wino.BackgroundTasks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wino.BackgroundTasks")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

View File

@@ -0,0 +1,48 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Serilog;
using Windows.ApplicationModel.Background;
using Windows.Storage;
using Wino.Core;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Services;
using Wino.Core.UWP;
using Wino.Services;
namespace Wino.BackgroundTasks
{
public sealed class SessionConnectedTask : IBackgroundTask
{
public async void Run(IBackgroundTaskInstance taskInstance)
{
var def = taskInstance.GetDeferral();
try
{
var services = new ServiceCollection();
services.RegisterCoreServices();
services.RegisterCoreUWPServices();
var providere = services.BuildServiceProvider();
var backgroundTaskService = providere.GetService<IBackgroundSynchronizer>();
var dbService = providere.GetService<IDatabaseService>();
var logInitializer = providere.GetService<ILogInitializer>();
logInitializer.SetupLogger(ApplicationData.Current.LocalFolder.Path);
await dbService.InitializeAsync();
await backgroundTaskService.RunBackgroundSynchronizationAsync(Core.Domain.Enums.BackgroundSynchronizationReason.SessionConnected);
}
catch (Exception ex)
{
Log.Error(ex, "Background synchronization failed from background task.");
}
finally
{
def.Complete();
}
}
}
}

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D9EF0F59-F5F2-4D6C-A5BA-84043D8F3E08}</ProjectGuid>
<OutputType>winmdobj</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Wino.BackgroundTasks</RootNamespace>
<AssemblyName>Wino.BackgroundTasks</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22621.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<PlatformTarget>ARM64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<PlatformTarget>ARM64</PlatformTarget>
<OutputPath>bin\ARM64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="AppUpdatedTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SessionConnectedTask.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.14</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
<Version>7.1.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Wino.Core.Domain\Wino.Core.Domain.csproj">
<Project>{CF3312E5-5DA0-4867-9945-49EA7598AF1F}</Project>
<Name>Wino.Core.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\Wino.Core.UWP\Wino.Core.UWP.csproj">
<Project>{395f19ba-1e42-495c-9db5-1a6f537fccb8}</Project>
<Name>Wino.Core.UWP</Name>
</ProjectReference>
<ProjectReference Include="..\Wino.Core\Wino.Core.csproj">
<Project>{e6b1632a-8901-41e8-9ddf-6793c7698b0b}</Project>
<Name>Wino.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<SDKReference Include="WindowsDesktop, Version=10.0.22621.0">
<Name>Windows Desktop Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

7
Wino.Calendar/App.xaml Normal file
View File

@@ -0,0 +1,7 @@
<Application
x:Class="Wino.Calendar.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Wino.Calendar">
</Application>

100
Wino.Calendar/App.xaml.cs Normal file
View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace Wino.Calendar
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,14 @@
<Page
x:Class="Wino.Calendar.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Wino.Calendar"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
</Grid>
</Page>

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace Wino.Calendar
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
}

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<!-- Publisher Cache Folders -->
<Extensions>
<Extension Category="windows.publisherCacheFolders">
<PublisherCacheFolders>
<Folder Name="WinoShared" />
</PublisherCacheFolders>
</Extension>
</Extensions>
<Identity
Name="58272BurakKSE.WinoCalendar"
Publisher="CN=51FBDAF3-E212-4149-89A2-A2636B3BC911"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="f047b7dd-96ec-4d54-a862-9321e271e449" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>Wino Calendar</DisplayName>
<PublisherDisplayName>Burak KÖSE</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="Wino.Calendar.App">
<uap:VisualElements
DisplayName="Wino Calendar"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="Wino.Calendar"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

View File

@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Wino.Calendar")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Wino.Calendar")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

View File

@@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{600F4979-DB7E-409D-B7DA-B60BE4C55C35}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Wino.Calendar</RootNamespace>
<AssemblyName>Wino.Calendar</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22621.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateThumbprint>125A5273FCFE8D551C3FED87F67C87A663E98F1B</PackageCertificateThumbprint>
<PackageCertificateKeyFile />
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<OutputPath>bin\ARM64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<None Include="Package.StoreAssociation.xml" />
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.14</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,14 @@
namespace Wino.Core.Domain
{
public static class Constants
{
/// <summary>
/// MIME header that exists in all the drafts created from Wino.
/// </summary>
public const string WinoLocalDraftHeader = "X-Wino-Draft-Id";
public const string LocalDraftStartPrefix = "localDraft_";
public const string ToastMailItemIdKey = nameof(ToastMailItemIdKey);
public const string ToastActionKey = nameof(ToastActionKey);
}
}

View File

@@ -0,0 +1,13 @@
using System;
using SQLite;
namespace Wino.Core.Domain.Entities
{
public class AccountSignature
{
[PrimaryKey]
public Guid Id { get; set; }
public string HtmlBody { get; set; }
}
}

View File

@@ -0,0 +1,53 @@
using SQLite;
using System;
using System.Collections.Generic;
namespace Wino.Core.Domain.Entities
{
/// <summary>
/// Back storage for simple name-address book.
/// These values will be inserted during MIME fetch.
/// </summary>
// TODO: This can easily evolve to Contact store, just like People app in Windows 10/11.
// Do it.
public class AddressInformation : IEquatable<AddressInformation>
{
[PrimaryKey]
public string Address { get; set; }
public string Name { get; set; }
public string DisplayName => Address == Name ? Address : $"{Name} <{Address}>";
public override bool Equals(object obj)
{
return Equals(obj as AddressInformation);
}
public bool Equals(AddressInformation other)
{
return !(other is null) &&
Address == other.Address &&
Name == other.Name;
}
public override int GetHashCode()
{
int hashCode = -1717786383;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Address);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);
return hashCode;
}
public static bool operator ==(AddressInformation left, AddressInformation right)
{
return EqualityComparer<AddressInformation>.Default.Equals(left, right);
}
public static bool operator !=(AddressInformation left, AddressInformation right)
{
return !(left == right);
}
}
}

View File

@@ -0,0 +1,49 @@
using System;
using SQLite;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Entities
{
public class CustomServerInformation
{
[PrimaryKey]
public Guid Id { get; set; }
public Guid AccountId { get; set; }
public string DisplayName { get; set; }
public string Address { get; set; }
public string IncomingServer { get; set; }
public string IncomingServerUsername { get; set; }
public string IncomingServerPassword { get; set; }
public string IncomingServerPort { get; set; }
public CustomIncomingServerType IncomingServerType { get; set; }
public string OutgoingServer { get; set; }
public string OutgoingServerPort { get; set; }
public string OutgoingServerUsername { get; set; }
public string OutgoingServerPassword { get; set; }
/// <summary>
/// useSSL True: SslOnConnect
/// useSSL False: StartTlsWhenAvailable
/// </summary>
public ImapConnectionSecurity IncomingServerSocketOption { get; set; }
public ImapAuthenticationMethod IncomingAuthenticationMethod { get; set; }
public ImapConnectionSecurity OutgoingServerSocketOption { get; set; }
public ImapAuthenticationMethod OutgoingAuthenticationMethod { get; set; }
public string ProxyServer { get; set; }
public string ProxyServerPort { get; set; }
[Obsolete("As 1.7.0")]
public bool IncomingRequiresSSL { get; set; }
[Obsolete("As 1.7.0")]
public bool OutgoingRequresSSL { get; set; }
}
}

View File

@@ -0,0 +1,78 @@
using System;
using SQLite;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Entities
{
public class MailAccount
{
[PrimaryKey]
public Guid Id { get; set; }
/// <summary>
/// Given name of the account in Wino.
/// </summary>
public string Name { get; set; }
/// <summary>
/// TODO: Display name of the authenticated user/account.
/// API integrations will query this value from the API.
/// IMAP is populated by user on setup dialog.
/// </summary>
public string ProfileName { get; set; }
/// <summary>
/// Account e-mail address.
/// </summary>
public string Address { get; set; }
/// <summary>
/// Provider type of the account. Outlook,Gmail etc...
/// </summary>
public MailProviderType ProviderType { get; set; }
/// <summary>
/// For tracking change delta.
/// Gmail : historyId
/// Outlook: deltaToken
/// </summary>
public string SynchronizationDeltaIdentifier { get; set; }
/// <summary>
/// Gets or sets the signature to be used for this account.
/// Null if no signature should be used.
/// </summary>
public Guid? SignatureId { get; set; }
/// <summary>
/// Gets or sets whether the account has any reason for an interactive user action to fix continue operating.
/// </summary>
public AccountAttentionReason AttentionReason { get; set; }
/// <summary>
/// Gets or sets the id of the merged inbox this account belongs to.
/// </summary>
public Guid? MergedInboxId { get; set; }
/// <summary>
/// Contains the merged inbox this account belongs to.
/// Ignored for all SQLite operations.
/// </summary>
[Ignore]
public MergedInbox MergedInbox { get; set; }
/// <summary>
/// Populated only when account has custom server information.
/// </summary>
[Ignore]
public CustomServerInformation ServerInformation { get; set; }
/// <summary>
/// Account preferences.
/// </summary>
[Ignore]
public MailAccountPreferences Preferences { get; set; }
}
}

View File

@@ -0,0 +1,39 @@
using System;
using SQLite;
namespace Wino.Core.Domain.Entities
{
public class MailAccountPreferences
{
[PrimaryKey]
public Guid Id { get; set; }
/// <summary>
/// Id of the account in MailAccount table.
/// </summary>
public Guid AccountId { get; set; }
/// <summary>
/// Gets or sets whether sent draft messages should be appended to the sent folder.
/// Some IMAP servers do this automatically, some don't.
/// It's disabled by default.
/// </summary>
public bool ShouldAppendMessagesToSentFolder { get; set; }
/// <summary>
/// Gets or sets whether the notifications are enabled for the account.
/// </summary>
public bool IsNotificationsEnabled { get; set; }
/// <summary>
/// Gets or sets the custom account identifier color in hex.
/// </summary>
public string AccountColorHex { get; set; }
/// <summary>
/// Gets or sets whether the account has Focused inbox support.
/// Null if the account provider type doesn't support Focused inbox.
/// </summary>
public bool? IsFocusedInboxEnabled { get; set; }
}
}

View File

@@ -0,0 +1,140 @@
using System;
using SQLite;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.MailItem;
namespace Wino.Core.Domain.Entities
{
/// <summary>
/// Summary of the parsed MIME messages.
/// Wino will do non-network operations on this table and others from the original MIME.
/// </summary>
public class MailCopy : IMailItem
{
/// <summary>
/// Unique Id of the mail.
/// </summary>
[PrimaryKey]
public Guid UniqueId { get; set; }
/// <summary>
/// Not unique id of the item. Some operations held on this Id, some on the UniqueId.
/// Same message can be in different folder. In that case UniqueId is used.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Folder that this mail belongs to.
/// </summary>
public Guid FolderId { get; set; }
/// <summary>
/// Conversation id for the mail.
/// </summary>
public string ThreadId { get; set; }
/// <summary>
/// MIME MessageId if exists.
/// </summary>
public string MessageId { get; set; }
/// <summary>
/// References header from MIME
/// </summary>
public string References { get; set; }
/// <summary>
/// In-Reply-To header from MIME
/// </summary>
public string InReplyTo { get; set; }
/// <summary>
/// Name for the sender.
/// </summary>
public string FromName { get; set; }
/// <summary>
/// Address of the sender.
/// </summary>
public string FromAddress { get; set; }
/// <summary>
/// Subject of the mail.
/// </summary>
public string Subject { get; set; }
/// <summary>
/// Short preview of the content.
/// </summary>
public string PreviewText { get; set; }
/// <summary>
/// Date that represents this mail has been created in provider servers.
/// Stored always in UTC.
/// </summary>
public DateTime CreationDate { get; set; }
/// <summary>
/// Importance of the mail.
/// </summary>
public MailImportance Importance { get; set; }
/// <summary>
/// Read status for the mail.
/// </summary>
public bool IsRead { get; set; }
/// <summary>
/// Flag status.
/// Flagged for Outlook.
/// Important for Gmail.
/// </summary>
public bool IsFlagged { get; set; }
/// <summary>
/// To support Outlook.
/// Gmail doesn't use it.
/// </summary>
public bool IsFocused { get; set; }
/// <summary>
/// Whether mail has attachments included or not.
/// </summary>
public bool HasAttachments { get; set; }
/// <summary>
/// Assigned draft id.
/// </summary>
public string DraftId { get; set; }
/// <summary>
/// Whether this copy is draft or not.
/// </summary>
public bool IsDraft { get; set; }
/// <summary>
/// File id that this mail is assigned to.
/// This Id is immutable. It's used to find the file in the file system.
/// Even after mapping local draft to remote draft, it will not change.
/// </summary>
public Guid FileId { get; set; }
/// <summary>
/// Folder that this mail is assigned to.
/// Warning: This field is not populated by queries.
/// Services or View Models are responsible for populating this field.
/// </summary>
[Ignore]
public MailItemFolder AssignedFolder { get; set; }
/// <summary>
/// Account that this mail is assigned to.
/// Warning: This field is not populated by queries.
/// Services or View Models are responsible for populating this field.
/// </summary>
[Ignore]
public MailAccount AssignedAccount { get; set; }
public override string ToString() => $"{Subject} <-> {Id}";
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using SQLite;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
namespace Wino.Core.Domain.Entities
{
[DebuggerDisplay("{FolderName} - {SpecialFolderType}")]
public class MailItemFolder : IMailItemFolder
{
[PrimaryKey]
public Guid Id { get; set; }
public string RemoteFolderId { get; set; }
public string ParentRemoteFolderId { get; set; }
public Guid MailAccountId { get; set; }
public string FolderName { get; set; }
public SpecialFolderType SpecialFolderType { get; set; }
public bool IsSystemFolder { get; set; }
public bool IsSticky { get; set; }
public bool IsSynchronizationEnabled { get; set; }
public bool IsHidden { get; set; }
public bool ShowUnreadCount { get; set; }
public DateTime? LastSynchronizedDate { get; set; }
// For IMAP
public uint UidValidity { get; set; }
public long HighestModeSeq { get; set; }
/// <summary>
/// Outlook shares delta changes per-folder. Gmail is for per-account.
/// This is only used for Outlook provider.
/// </summary>
public string DeltaToken { get; set; }
// For GMail Labels
public string TextColorHex { get; set; }
public string BackgroundColorHex { get; set; }
[Ignore]
public List<IMailItemFolder> ChildFolders { get; set; } = [];
// Category and Move type folders are not valid move targets.
// These folders are virtual. They don't exist on the server.
public bool IsMoveTarget => !(SpecialFolderType == SpecialFolderType.More || SpecialFolderType == SpecialFolderType.Category);
public bool ContainsSpecialFolderType(SpecialFolderType type)
{
if (SpecialFolderType == type)
return true;
foreach (var child in ChildFolders)
{
if (child.SpecialFolderType == type)
{
return true;
}
else
{
return child.ContainsSpecialFolderType(type);
}
}
return false;
}
public override string ToString() => FolderName;
}
}

View File

@@ -0,0 +1,13 @@
using System;
using SQLite;
namespace Wino.Core.Domain.Entities
{
public class MergedInbox
{
[PrimaryKey]
public Guid Id { get; set; }
public string Name { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Wino.Core.Domain.Entities
{
public record SystemFolderConfiguration(MailItemFolder SentFolder,
MailItemFolder DraftFolder,
MailItemFolder ArchiveFolder,
MailItemFolder TrashFolder,
MailItemFolder JunkFolder);
}

View File

@@ -0,0 +1,26 @@
using System;
using SQLite;
using Wino.Core.Domain.Models.Authentication;
namespace Wino.Core.Domain.Entities
{
public class TokenInformation : TokenInformationBase
{
[PrimaryKey]
public Guid Id { get; set; }
public Guid AccountId { get; set; }
public string Address { get; set; }
public void RefreshTokens(TokenInformationBase tokenInformationBase)
{
if (tokenInformationBase == null)
throw new ArgumentNullException(nameof(tokenInformationBase));
AccessToken = tokenInformationBase.AccessToken;
RefreshToken = tokenInformationBase.RefreshToken;
ExpiresAt = tokenInformationBase.ExpiresAt;
}
}
}

View File

@@ -0,0 +1,9 @@
namespace Wino.Core.Domain.Enums
{
public enum AccountAttentionReason
{
None,
InvalidCredentials,
MissingSystemFolderConfiguration
}
}

View File

@@ -0,0 +1,14 @@
namespace Wino.Core.Domain.Enums
{
public enum AccountCreationDialogState
{
Idle,
SigningIn,
PreparingFolders,
Completed,
ManuelSetupWaiting,
TestingConnection,
AutoDiscoverySetup,
AutoDiscoveryInProgress
}
}

View File

@@ -0,0 +1,12 @@
namespace Wino.Core.Domain.Enums
{
/// <summary>
/// Indicates the state of synchronizer.
/// </summary>
public enum AccountSynchronizerState
{
Idle,
ExecutingRequests,
Synchronizing
}
}

View File

@@ -0,0 +1,16 @@
namespace Wino.Core.Domain.Enums
{
public enum AppLanguage
{
None,
English,
Deutsch,
Russian,
Turkish,
Polish,
Czech,
Chinese,
Spanish,
French
}
}

View File

@@ -0,0 +1,9 @@
namespace Wino.Core.Domain.Enums
{
public enum AppThemeType
{
System,
PreDefined,
Custom,
}
}

View File

@@ -0,0 +1,9 @@
namespace Wino.Core.Domain.Enums
{
public enum ApplicationElementTheme
{
Default,
Light,
Dark
}
}

View File

@@ -0,0 +1,8 @@
namespace Wino.Core.Domain.Enums
{
public enum BackgroundSynchronizationReason
{
SessionConnected,
Timer
}
}

View File

@@ -0,0 +1,24 @@
namespace Wino.Core.Domain.Enums
{
public enum ChangeRequestType
{
MailMarkAs,
MailChangeFlag,
MailHardDelete,
MailMove,
MailAlwaysMoveTo,
MailChangeFocused,
MailArchive,
MailUnarchive,
FolderMarkAsRead,
FolderDelete,
FolderEmpty,
FolderRename,
CreateNewDraft,
CreateReplyDraft,
CreateForwardDraft,
DiscardDraft,
SendDraft,
FetchSingleItem
}
}

View File

@@ -0,0 +1,8 @@
namespace Wino.Core.Domain.Enums
{
public enum CustomIncomingServerType
{
POP3,
IMAP4
}
}

View File

@@ -0,0 +1,10 @@
namespace Wino.Core.Domain.Enums
{
public enum DraftCreationReason
{
Empty,
Reply,
ReplyAll,
Forward
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Core.Domain.Enums
{
public enum EditorToolbarSectionType
{
None,
Format,
Insert,
Draw,
Options
}
}

View File

@@ -0,0 +1,10 @@
namespace Wino.Core.Domain.Enums
{
public enum FilterOptionType
{
All,
Unread,
Flagged,
Mentions
}
}

View File

@@ -0,0 +1,23 @@
namespace Wino.Core.Domain.Enums
{
/// <summary>
/// Defines all possible folder operations that can be done.
/// Available values for each folder is returned by IContextMenuProvider
/// that integrators hold.
/// </summary>
public enum FolderOperation
{
None,
Pin,
Unpin,
MarkAllAsRead,
DontSync,
Empty,
Rename,
Delete,
Move,
TurnOffNotifications,
CreateSubFolder,
Seperator
}
}

View File

@@ -0,0 +1,13 @@
namespace Wino.Core.Domain.Enums
{
public enum ImapAuthenticationMethod
{
Auto,
None,
NormalPassword,
EncryptedPassword,
Ntlm,
CramMd5,
DigestMd5
}
}

View File

@@ -0,0 +1,10 @@
namespace Wino.Core.Domain.Enums
{
public enum ImapConnectionSecurity
{
Auto,
None,
StartTls,
SslTls
}
}

View File

@@ -0,0 +1,8 @@
namespace Wino.Core.Domain.Enums
{
public enum InfoBarAnimationType
{
SlideFromRightToLeft,
SlideFromBottomToTop
}
}

View File

@@ -0,0 +1,10 @@
namespace Wino.Core.Domain.Enums
{
public enum InfoBarMessageType
{
Information,
Success,
Warning,
Error
}
}

View File

@@ -0,0 +1,16 @@
namespace Wino.Core.Domain.Enums
{
public enum MailAttachmentType
{
None,
Executable,
Image,
Audio,
Video,
PDF,
HTML,
RarArchive,
Archive,
Other
}
}

View File

@@ -0,0 +1,9 @@
namespace Wino.Core.Domain.Enums
{
public enum MailImportance
{
Low,
Normal,
High
}
}

View File

@@ -0,0 +1,9 @@
namespace Wino.Core.Domain.Enums
{
public enum MailListDisplayMode
{
Spacious,
Medium,
Compact,
}
}

View File

@@ -0,0 +1,9 @@
namespace Wino.Core.Domain.Enums
{
public enum MailMarkAsOption
{
WhenSelected,
DontMark,
AfterDelay
}
}

View File

@@ -0,0 +1,49 @@
namespace Wino.Core.Domain.Enums
{
// Synchronizer requests.
public enum MailSynchronizerOperation
{
MarkRead,
Move,
Delete, // Hard delete.
CreateDraft,
Send,
ChangeFlag,
AlwaysMoveTo,
MoveToFocused,
RenameFolder
}
// UI requests
public enum MailOperation
{
None,
Archive,
UnArchive,
SoftDelete,
HardDelete,
Move,
MoveToJunk,
MoveToFocused,
MoveToOther,
AlwaysMoveToOther,
AlwaysMoveToFocused,
SetFlag,
ClearFlag,
MarkAsRead,
MarkAsUnread,
MarkAsNotJunk,
Seperator,
Ignore,
Reply,
ReplyAll,
Zoom,
SaveAs,
Find,
Forward,
DarkEditor,
LightEditor,
Print,
Navigate // For toast activation
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Core.Domain.Enums
{
public enum MailProviderType
{
Outlook,
Gmail,
Office365,
Yahoo,
IMAP4
}
}

View File

@@ -0,0 +1,8 @@
namespace Wino.Core.Domain.Enums
{
public enum MenuPaneMode
{
Visible,
Hidden
}
}

View File

@@ -0,0 +1,8 @@
namespace Wino.Core.Domain.Enums
{
public enum NavigationReferenceFrame
{
ShellFrame,
RenderingFrame
}
}

View File

@@ -0,0 +1,12 @@
namespace Wino.Core.Domain.Enums
{
/// <summary>
/// Defines the potential reasons for picking folder in the folder picking dialog.
/// </summary>
public enum PickFolderReason
{
Move,
SpecialFolder,
Any
}
}

View File

@@ -0,0 +1,15 @@
namespace Wino.Core.Domain.Enums
{
public enum ReaderFont
{
Arial,
TimesNewRoman,
Verdana,
Tahoma,
CourierNew,
Georgia,
TrebuchetMS,
Calibri,
Helvetica
}
}

View File

@@ -0,0 +1,8 @@
namespace Wino.Core.Domain.Enums
{
public enum SortingOptionType
{
ReceiveDate,
Sender
}
}

View File

@@ -0,0 +1,24 @@
namespace Wino.Core.Domain.Enums
{
public enum SpecialFolderType
{
Inbox,
Starred,
Important,
Sent,
Draft,
Archive,
Deleted,
Junk,
Chat,
Category,
Unread,
Forums,
Updates,
Personal,
Promotions,
Social,
Other,
More
}
}

View File

@@ -0,0 +1,19 @@
namespace Wino.Core.Domain.Enums
{
// From the SDK.
public enum StorePurchaseResult
{
//
// Summary:
// The purchase request succeeded.
Succeeded,
//
// Summary:
// The current user has already purchased the specified app or add-on.
AlreadyPurchased,
//
// Summary:
// The purchase request did not succeed.
NotPurchased,
}
}

View File

@@ -0,0 +1,9 @@
namespace Wino.Core.Domain.Enums
{
public enum SynchronizationCompletedState
{
Success, // All succeeded.
Canceled, // Canceled by user or HTTP call.
Failed // Exception.
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Core.Domain.Enums
{
public enum SynchronizationType
{
FoldersOnly, // Only synchronize folder metadata.
ExecuteRequests, // Run the queued requests, and then synchronize if needed.
Inbox, // Only Inbox
Custom, // Only sync folders that are specified in the options.
Full, // Synchronize everything
}
}

View File

@@ -0,0 +1,25 @@
namespace Wino.Core.Domain.Enums
{
/// <summary>
/// All registered views.
/// </summary>
public enum WinoPage
{
None,
IdlePage,
ComposePage,
SettingsPage,
MailRenderingPage,
WelcomePage,
AccountDetailsPage,
MergedAccountDetailsPage,
AccountManagementPage,
SignatureManagementPage,
AboutPage,
PersonalizationPage,
MessageListPage,
MailListPage,
ReadingPanePage,
SettingOptionsPage
}
}

View File

@@ -0,0 +1,7 @@
namespace Wino.Core.Domain.Exceptions
{
public class AccountSetupCanceledException : System.Exception
{
}
}

View File

@@ -0,0 +1,19 @@
using System;
using Wino.Core.Domain.Entities;
namespace Wino.Core.Domain.Exceptions
{
/// <summary>
/// Thrown when IAuthenticator requires user interaction to fix authentication issues.
/// It can be expired and can't restorable token, or some stuff that requires re-authentication.
/// </summary>
public class AuthenticationAttentionException : Exception
{
public AuthenticationAttentionException(MailAccount account)
{
Account = account;
}
public MailAccount Account { get; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
/// <summary>
/// All exceptions related to authentication.
/// </summary>
public class AuthenticationException : Exception
{
public AuthenticationException(string message) : base(message)
{
}
public AuthenticationException(string message, Exception innerException) : base(message, innerException)
{
}
}
}

View File

@@ -0,0 +1,9 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
/// <summary>
/// An exception thrown when the background task execution policies are denied for some reason.
/// </summary>
public class BackgroundTaskExecutionRequestDeniedException : Exception { }
}

View File

@@ -0,0 +1,9 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
/// <summary>
/// An exception thrown when the background task registration is failed.
/// </summary>
public class BackgroundTaskRegistrationFailedException : Exception { }
}

View File

@@ -0,0 +1,11 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
/// <summary>
/// Thrown when composer cant find the mime to load.
/// </summary>
public class ComposerMimeNotFoundException : Exception
{
}
}

View File

@@ -0,0 +1,11 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
public class CustomThemeCreationFailedException : Exception
{
public CustomThemeCreationFailedException(string message) : base(message)
{
}
}
}

View File

@@ -0,0 +1,7 @@
namespace Wino.Core.Domain.Exceptions
{
public class GoogleAuthenticationException : System.Exception
{
public GoogleAuthenticationException(string message) : base(message) { }
}
}

View File

@@ -0,0 +1,11 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
public class ImapClientPoolException : Exception
{
public ImapClientPoolException(Exception innerException) : base(Translator.Exception_ImapClientPoolFailed, innerException)
{
}
}
}

View File

@@ -0,0 +1,6 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
public class InvalidMoveTargetException : Exception { }
}

View File

@@ -0,0 +1,11 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
public class SynchronizerEntityNotFoundException : Exception
{
public SynchronizerEntityNotFoundException(string message) : base(message)
{
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
namespace Wino.Core.Domain.Exceptions
{
public class SynchronizerException : Exception
{
public SynchronizerException(string message) : base(message)
{
}
public SynchronizerException(string message, Exception innerException) : base(message, innerException)
{
}
}
}

View File

@@ -0,0 +1,7 @@
namespace Wino.Core.Domain.Exceptions
{
/// <summary>
/// When IMAP account's system folder configuration setup is not done yet.
/// </summary>
public class SystemFolderConfigurationMissingException : System.Exception { }
}

View File

@@ -0,0 +1,20 @@
using System;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Exceptions
{
/// <summary>
/// Emitted when special folder is needed for an operation but it couldn't be found.
/// </summary>
public class UnavailableSpecialFolderException : Exception
{
public UnavailableSpecialFolderException(SpecialFolderType specialFolderType, Guid accountId)
{
SpecialFolderType = specialFolderType;
AccountId = accountId;
}
public SpecialFolderType SpecialFolderType { get; }
public Guid AccountId { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// An interface that should force synchronizer to do synchronization for only given folder ids
/// after the execution is completed.
/// </summary>
public interface ICustomFolderSynchronizationRequest
{
/// <summary>
/// Which folders to sync after this operation?
/// </summary>
List<Guid> SynchronizationFolderIds { get; }
}
}

View File

@@ -0,0 +1,11 @@
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountCreationDialog
{
void ShowDialog();
void Complete();
AccountCreationDialogState State { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System.Collections.Generic;
using Wino.Core.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountMenuItem : IMenuItem
{
double SynchronizationProgress { get; set; }
int UnreadItemCount { get; set; }
IEnumerable<MailAccount> HoldingAccounts { get; }
void UpdateAccount(MailAccount account);
}
}

View File

@@ -0,0 +1,6 @@
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountPickerDialog
{
}
}

View File

@@ -0,0 +1,17 @@
using System;
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountProviderDetailViewModel
{
/// <summary>
/// Entity id that will help to identify the startup entity on launch.
/// </summary>
Guid StartupEntityId { get; }
/// <summary>
/// Name representation of the view model that will be used to identify the startup entity on launch.
/// </summary>
string StartupEntityTitle { get; }
}
}

View File

@@ -0,0 +1,11 @@
using Wino.Core.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountProviderDetails
{
MailAccount Account { get; set; }
bool AutoExtend { get; set; }
IProviderDetail ProviderDetail { get; set; }
}
}

View File

@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountService
{
/// <summary>
/// Current IAuthenticator that should receive external authentication process to continue with.
/// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator
/// to continue process for token exchange.
/// </summary>
IAuthenticator ExternalAuthenticationAuthenticator { get; set; }
/// <summary>
/// Returns all local accounts.
/// </summary>
/// <returns>All local accounts</returns>
Task<List<MailAccount>> GetAccountsAsync();
/// <summary>
/// Returns single MailAccount
/// </summary>
/// <param name="accountId">AccountId.</param>
Task<MailAccount> GetAccountAsync(Guid accountId);
/// <summary>
/// Deletes all information about the account, including token information.
/// </summary>
/// <param name="account">MailAccount to be removed</param>
Task DeleteAccountAsync(MailAccount account);
/// <summary>
/// Returns the custom server information for the given account id.
/// </summary>
Task<CustomServerInformation> GetAccountCustomServerInformationAsync(Guid accountId);
/// <summary>
/// Updates the given account properties.
/// </summary>
Task UpdateAccountAsync(MailAccount account);
/// <summary>
/// Creates new account with the given server information if any.
/// Also sets the account as Startup account if there are no accounts.
/// </summary>
Task CreateAccountAsync(MailAccount account, TokenInformation tokenInformation, CustomServerInformation customServerInformation);
/// <summary>
/// Fixed authentication errors for account by forcing interactive login.
/// </summary>
Task FixTokenIssuesAsync(Guid accountId);
/// <summary>
/// Removed the attention from an account.
/// </summary>
/// <param name="accountId">Account id to remove from</param>
Task ClearAccountAttentionAsync(Guid accountId);
/// <summary>
/// Updates the account synchronization identifier.
/// For example: Gmail uses this identifier to keep track of the last synchronization.
/// Update is ignored for Gmail if the new identifier is older than the current one.
/// </summary>
/// <param name="newIdentifier">Identifier to update</param>
/// <returns>Current account synchronization modifier.</returns>
Task<string> UpdateSynchronizationIdentifierAsync(Guid accountId, string newIdentifier);
Task RenameMergedAccountAsync(Guid mergedInboxId, string newName);
Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable<MailAccount> accountsToMerge);
Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable<Guid> linkedAccountIds);
Task UnlinkMergedInboxAsync(Guid mergedInboxId);
}
}

View File

@@ -0,0 +1,11 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
{
public interface IAppInitializerService
{
string GetApplicationDataFolder();
Task MigrateAsync();
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Core.Domain.Interfaces
{
public interface IApplicationResourceManager<T>
{
void RemoveResource(T resource);
void AddResource(T resource);
bool ContainsResourceKey(string resourceKey);
void ReplaceResource(string resourceKey, object resource);
T GetLastResource();
}
}

View File

@@ -0,0 +1,9 @@
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
{
public interface IAuthenticationProvider
{
IAuthenticator GetAuthenticator(MailProviderType providerType);
}
}

View File

@@ -0,0 +1,53 @@
using System;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
{
public interface IAuthenticator
{
/// <summary>
/// Type of the provider.
/// </summary>
MailProviderType ProviderType { get; }
/// <summary>
/// Gets the token from the cache if exists.
/// If the token is expired, tries to refresh.
/// This can throw AuthenticationAttentionException if silent refresh fails.
/// </summary>
/// <param name="account">Account to get token for.</param>
/// <returns>Valid token info to be used in integrators.</returns>
Task<TokenInformation> GetTokenAsync(MailAccount account);
/// <summary>
/// Initial creation of token. Requires user interaction.
/// This will save token into database, but still returns for account creation
/// since account address is required.
/// </summary>
/// <param name="expectedAccountAddress">Token cache might ask for regeneration of token for specific
/// account address. If one is provided and re-generation native token doesn't belong to this address
/// token saving to database won't happen.</param>
/// <returns>Freshly created TokenInformation..</returns>
Task<TokenInformation> GenerateTokenAsync(MailAccount account, bool saveToken);
/// <summary>
/// Required for external authorization on launched browser to continue.
/// Used for Gmail.
/// </summary>
/// <param name="authorizationResponseUri">Response's redirect uri.</param>
void ContinueAuthorization(Uri authorizationResponseUri);
/// <summary>
/// For external browser required authentications.
/// Canceling Gmail authentication dialog etc.
/// </summary>
void CancelAuthorization();
/// <summary>
/// ClientId in case of needed for authorization/authentication.
/// </summary>
string ClientId { get; }
}
}

View File

@@ -0,0 +1,18 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Models.AutoDiscovery;
namespace Wino.Core.Domain.Interfaces
{
/// <summary>
/// Searches for Auto Discovery settings for custom mail accounts.
/// </summary>
public interface IAutoDiscoveryService
{
/// <summary>
/// Tries to return the best mail server settings using different techniques.
/// </summary>
/// <param name="mailAddress">Address to search settings for.</param>
/// <returns>CustomServerInformation with only settings applied.</returns>
Task<AutoDiscoverySettings> GetAutoDiscoverySettings(AutoDiscoveryMinimalSettings autoDiscoveryMinimalSettings);
}
}

View File

@@ -0,0 +1,19 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
{
public interface IBackgroundTaskService
{
/// <summary>
/// Manages background task registrations, requests access if needed, checks the statusses of them etc.
/// </summary>
/// <exception cref="BackgroundTaskExecutionRequestDeniedException">If the access request is denied for some reason.</exception>
/// <exception cref="BackgroundTaskRegistrationFailedException">If one of the requires background tasks are failed during registration.</exception>
Task HandleBackgroundTaskRegistrations();
/// <summary>
/// Unregisters all existing background tasks. Useful for migrations.
/// </summary>
void UnregisterAllBackgroundTask();
}
}

View File

@@ -0,0 +1,9 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
{
public interface IClipboardService
{
Task CopyClipboardAsync(string text);
}
}

View File

@@ -0,0 +1,11 @@
namespace Wino.Core.Domain.Interfaces
{
public interface IConfigurationService
{
void Set(string key, object value);
T Get<T>(string key, T defaultValue = default);
void SetRoaming(string key, object value);
T GetRoaming<T>(string key, T defaultValue = default);
}
}

View File

@@ -0,0 +1,9 @@
using System.Threading.Tasks;
namespace Wino.Core.Domain.Interfaces
{
public interface IConfirmationDialog
{
Task<bool> ShowDialogAsync(string title, string message, string approveButtonTitle);
}
}

View File

@@ -0,0 +1,14 @@
using System.Collections.Generic;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces
{
public interface IContextMenuItemService
{
IEnumerable<FolderOperationMenuItem> GetFolderContextMenuActions(IBaseFolderMenuItem folderInformation);
IEnumerable<MailOperationMenuItem> GetMailItemContextMenuActions(IEnumerable<IMailItem> selectedMailItems);
IEnumerable<MailOperationMenuItem> GetMailItemRenderMenuActions(IMailItem mailItem, bool isDarkEditor);
}
}

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
namespace Wino.Core.Domain.Interfaces
{
public interface IContextMenuProvider
{
/// <summary>
/// Calculates and returns available folder operations for the given folder.
/// </summary>
/// <param name="folderInformation">Folder to get actions for.</param>
IEnumerable<FolderOperationMenuItem> GetFolderContextMenuActions(IMailItemFolder folderInformation);
/// <summary>
/// Calculates and returns available context menu items for selected mail items.
/// </summary>
/// <param name="folderInformation">Current folder that asks for the menu items.</param>
/// <param name="selectedMailItems">Selected menu items in the given folder.</param>
IEnumerable<MailOperationMenuItem> GetMailItemContextMenuActions(IMailItemFolder folderInformation, IEnumerable<IMailItem> selectedMailItems);
/// <summary>
/// Calculates and returns available mail operations for mail rendering CommandBar.
/// </summary>
/// <param name="mailItem">Rendered mail item.</param>
/// <param name="activeFolder">Folder that mail item belongs to.</param>
IEnumerable<MailOperationMenuItem> GetMailItemRenderMenuActions(IMailItem mailItem, IMailItemFolder activeFolder, bool isDarkEditor);
}
}

View File

@@ -0,0 +1,19 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
namespace Wino.Core.Domain.Interfaces
{
public interface ICustomServerAccountCreationDialog : IAccountCreationDialog
{
/// <summary>
/// Returns the custom server information from the dialog..
/// </summary>
/// <returns>Null if canceled.</returns>
Task<CustomServerInformation> GetCustomServerInformationAsync();
/// <summary>
/// Displays preparing folders page.
/// </summary>
void ShowPreparingFolders();
}
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Entities;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
namespace Wino.Core.Domain.Interfaces
{
public interface IDialogService
{
Task<string> PickWindowsFolderAsync();
Task<byte[]> PickWindowsFileContentAsync(params object[] typeFilters);
Task<bool> ShowConfirmationDialogAsync(string question, string title, string confirmationButtonTitle);
Task<bool> ShowHardDeleteConfirmationAsync();
Task<IStoreRatingDialog> ShowRatingDialogAsync();
Task HandleSystemFolderConfigurationDialogAsync(Guid accountId, IFolderService folderService);
Task<bool> ShowCustomThemeBuilderDialogAsync();
Task ShowMessageAsync(string message, string title);
void InfoBarMessage(string title, string message, InfoBarMessageType messageType);
void InfoBarMessage(string title, string message, InfoBarMessageType messageType, string actionButtonText, Action action);
void ShowNotSupportedMessage();
// Custom dialogs
Task<IMailItemFolder> ShowMoveMailFolderDialogAsync(List<IMailItemFolder> availableFolders);
Task<Tuple<string, MailProviderType>> ShowNewAccountMailProviderDialogAsync(List<IProviderDetail> availableProviders);
IAccountCreationDialog GetAccountCreationDialog(MailProviderType type);
Task<string> ShowTextInputDialogAsync(string currentInput, string dialogTitle, string dialogDescription);
Task<MailAccount> ShowEditAccountDialogAsync(MailAccount account);
Task<MailAccount> ShowAccountPickerDialogAsync(List<MailAccount> availableAccounts);
/// <summary>
/// Presents a dialog to the user for selecting folder.
/// </summary>
/// <param name="accountId">Account to get folders for.</param>
/// <param name="reason">The reason behind the picking operation
/// <returns>Selected folder structure. Null if none.</returns>
Task<IMailItemFolder> PickFolderAsync(Guid accountId, PickFolderReason reason, IFolderService folderService);
}
}

Some files were not shown because too many files have changed in this diff Show More