mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00

Refactor the Database Service (no more enum, ...) Restored the Donate page with Paypal web page Added (but not working) MS App Center integration Corrected tests accordingly WIP AOP to detect database changes
27 lines
727 B
C#
27 lines
727 B
C#
using System.Reflection;
|
|
using ModernKeePass.Interfaces;
|
|
|
|
namespace ModernKeePass.Aop
|
|
{
|
|
public class DatabaseChangedProxy<T>: IProxyInvocationHandler
|
|
{
|
|
private readonly T _decorated;
|
|
private readonly IDatabaseService _databaseService;
|
|
|
|
public DatabaseChangedProxy(T decorated, IDatabaseService databaseService)
|
|
{
|
|
_decorated = decorated;
|
|
_databaseService = databaseService;
|
|
}
|
|
|
|
public object Invoke(object proxy, MethodInfo method, object[] parameters)
|
|
{
|
|
object retVal = null;
|
|
retVal = method.Invoke(proxy, parameters);
|
|
_databaseService.HasChanged = true;
|
|
|
|
return retVal;
|
|
}
|
|
}
|
|
}
|