mirror of
https://github.com/wismna/ModernKeePassLib.git
synced 2025-10-03 15:40:20 -04:00
Downgrade to net standard 1.2
This commit is contained in:
@@ -21,11 +21,13 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
#if !KeePassUAP
|
||||
#if ModernKeePassLib
|
||||
using ModernKeePassLib.Cryptography.Hash;
|
||||
#elif !KeePassUAP
|
||||
using System.Security.Cryptography;
|
||||
#endif
|
||||
|
||||
using ModernKeePassLib.Resources;
|
||||
using ModernKeePassLib.Security;
|
||||
using ModernKeePassLib.Utility;
|
||||
|
||||
@@ -163,5 +165,58 @@ namespace ModernKeePassLib.Cryptography.PasswordGenerator
|
||||
psOut = pwd;
|
||||
return PwgError.Success;
|
||||
}
|
||||
|
||||
internal static string ErrorToString(PwgError e, bool bHeader)
|
||||
{
|
||||
if(e == PwgError.Success) { Debug.Assert(false); return string.Empty; }
|
||||
if((e == PwgError.Unknown) && bHeader) return KLRes.PwGenFailed;
|
||||
|
||||
string str = KLRes.UnknownError;
|
||||
switch(e)
|
||||
{
|
||||
// case PwgError.Success:
|
||||
// break;
|
||||
|
||||
case PwgError.Unknown:
|
||||
break;
|
||||
|
||||
case PwgError.TooFewCharacters:
|
||||
str = KLRes.CharSetTooFewChars;
|
||||
break;
|
||||
|
||||
case PwgError.UnknownAlgorithm:
|
||||
str = KLRes.AlgorithmUnknown;
|
||||
break;
|
||||
|
||||
case PwgError.InvalidCharSet:
|
||||
str = KLRes.CharSetInvalid;
|
||||
break;
|
||||
|
||||
case PwgError.InvalidPattern:
|
||||
str = KLRes.PatternInvalid;
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.Assert(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if(bHeader)
|
||||
str = KLRes.PwGenFailed + MessageService.NewParagraph + str;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
internal static string ErrorToString(Exception ex, bool bHeader)
|
||||
{
|
||||
string str = KLRes.UnknownError;
|
||||
if((ex != null) && !string.IsNullOrEmpty(ex.Message))
|
||||
str = ex.Message;
|
||||
|
||||
if(bHeader)
|
||||
str = KLRes.PwGenFailed + MessageService.NewParagraph + str;
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user