Synchronization manager.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Windows.ApplicationModel.AppService;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.ViewModels;
|
||||
using Wino.Core.WinUI.Services;
|
||||
@@ -12,10 +11,6 @@ public static class CoreUWPContainerSetup
|
||||
{
|
||||
public static void RegisterCoreUWPServices(this IServiceCollection services)
|
||||
{
|
||||
var serverConnectionManager = new EmptyWinoServerConnectionManager<AppServiceConnection>();
|
||||
|
||||
services.AddSingleton<IWinoServerConnectionManager>(serverConnectionManager);
|
||||
services.AddSingleton<IWinoServerConnectionManager<AppServiceConnection>>(serverConnectionManager);
|
||||
services.AddSingleton<IApplicationResourceManager<ResourceDictionary>, ApplicationResourceManager>();
|
||||
|
||||
services.AddSingleton<IUnderlyingThemeService, UnderlyingThemeService>();
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.WinUI.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Empty implementation of IWinoServerConnectionManager that returns default values.
|
||||
/// This replaces the old AppServiceConnection-based implementation.
|
||||
/// </summary>
|
||||
public class EmptyWinoServerConnectionManager : IWinoServerConnectionManager
|
||||
{
|
||||
public event EventHandler<WinoServerConnectionStatus> StatusChanged { add { } remove { } }
|
||||
|
||||
public WinoServerConnectionStatus Status => WinoServerConnectionStatus.Connected;
|
||||
|
||||
public TaskCompletionSource<bool> ConnectingHandle { get; } = new TaskCompletionSource<bool>();
|
||||
|
||||
public EmptyWinoServerConnectionManager()
|
||||
{
|
||||
ConnectingHandle.SetResult(true);
|
||||
}
|
||||
|
||||
public Task<bool> ConnectAsync()
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
|
||||
public Task QueueRequestAsync(IRequestBase request, Guid accountId)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<WinoServerResponse<TResponse>> GetResponseAsync<TResponse, TRequestType>(TRequestType clientMessage, CancellationToken cancellationToken = default)
|
||||
where TRequestType : IClientMessage
|
||||
{
|
||||
var response = WinoServerResponse<TResponse>.CreateSuccessResponse(default(TResponse));
|
||||
return Task.FromResult(response);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generic empty implementation for typed connection managers.
|
||||
/// </summary>
|
||||
/// <typeparam name="TAppServiceConnection">The connection type (not used in this implementation)</typeparam>
|
||||
public class EmptyWinoServerConnectionManager<TAppServiceConnection> : EmptyWinoServerConnectionManager, IWinoServerConnectionManager<TAppServiceConnection>
|
||||
{
|
||||
public TAppServiceConnection Connection { get; set; }
|
||||
|
||||
public Task InitializeAsync()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ using Windows.Storage;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Translations;
|
||||
using Wino.Core.Services;
|
||||
using Wino.Messaging.Client.Shell;
|
||||
using Wino.Services;
|
||||
using WinUIEx;
|
||||
@@ -84,6 +85,7 @@ public abstract class WinoApplication : Application, IRecipient<LanguageChanged>
|
||||
yield return DatabaseService;
|
||||
yield return TranslationService;
|
||||
yield return NewThemeService; // Initialize NewThemeService instead of old ThemeService
|
||||
yield return Services.GetService<SynchronizationManagerInitializer>();
|
||||
// yield return ThemeService; // Keep old service for backward compatibility but don't initialize
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user