mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Cleanup code
This commit is contained in:
@@ -34,6 +34,16 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
|
@@ -6,7 +6,6 @@ using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Dtos;
|
||||
using ModernKeePass.Domain.Entities;
|
||||
using ModernKeePass.Domain.Enums;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
using ModernKeePassLib;
|
||||
using ModernKeePassLib.Cryptography.KeyDerivation;
|
||||
@@ -126,6 +125,8 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
_pwDatabase.Name = name;
|
||||
_pwDatabase.RootGroup.Name = name;
|
||||
|
||||
_credentials = credentials;
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case DatabaseVersion.V4:
|
||||
@@ -142,34 +143,20 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
|
||||
public async Task<byte[]> SaveDatabase()
|
||||
{
|
||||
try
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
_pwDatabase.Save(new NullStatusLogger());
|
||||
return _pwDatabase.IOConnectionInfo.Bytes;
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new SaveException(e);
|
||||
}
|
||||
_pwDatabase.Save(new NullStatusLogger());
|
||||
return _pwDatabase.IOConnectionInfo.Bytes;
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<byte[]> SaveDatabase(byte[] newFileContents)
|
||||
{
|
||||
try
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
_pwDatabase.SaveAs(IOConnectionInfo.FromByteArray(newFileContents), true, new NullStatusLogger());
|
||||
return _pwDatabase.IOConnectionInfo.Bytes;
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new SaveException(e);
|
||||
}
|
||||
_pwDatabase.SaveAs(IOConnectionInfo.FromByteArray(newFileContents), true, new NullStatusLogger());
|
||||
return _pwDatabase.IOConnectionInfo.Bytes;
|
||||
});
|
||||
}
|
||||
|
||||
public void CloseDatabase()
|
||||
|
@@ -1,7 +1,5 @@
|
||||
using System.Resources;
|
||||
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
|
||||
|
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Storage.AccessCache;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
|
Reference in New Issue
Block a user