mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Changed most services to singletons
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
This commit is contained in:
26
ModernKeePass/Aop/DatabaseChangedProxy.cs
Normal file
26
ModernKeePass/Aop/DatabaseChangedProxy.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user