port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.Reactive;
using Akavache;
using ReactiveUI;
namespace Intromat
{
public class AkavacheSuspensionDriver<TAppState> : ISuspensionDriver where TAppState : class
{
private const string AppStateKey = "appState";
public AkavacheSuspensionDriver()
{
BlobCache.ApplicationName = "Your Application Name";
}
public IObservable<Unit> InvalidateState()
{
return BlobCache.UserAccount.InvalidateObject<TAppState>(AppStateKey);
}
public IObservable<object> LoadState()
{
return BlobCache.UserAccount.GetObject<TAppState>(AppStateKey)!;
}
public IObservable<Unit> SaveState(object state)
{
return BlobCache.UserAccount.InsertObject(AppStateKey, (TAppState)state);
}
}
}