mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
ModernKeePassLib namespace restoration
This commit is contained in:
@@ -27,7 +27,7 @@ using System.Diagnostics;
|
||||
using System.IO.Compression;
|
||||
#endif
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Application-wide logging services.
|
||||
|
@@ -3,7 +3,7 @@ using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Replacement for System.Drawing.ColorTranslator.
|
||||
|
@@ -21,7 +21,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
#if ModernKeePassLibPCL
|
||||
#if ModernKeePassLib
|
||||
using Splat;
|
||||
#else
|
||||
using System.Drawing;
|
||||
@@ -29,7 +29,7 @@ using System.Drawing.Imaging;
|
||||
#endif
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
public static class GfxUtil
|
||||
{
|
||||
@@ -40,7 +40,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
try { return Image.FromStream(ms); }
|
||||
finally { ms.Close(); }
|
||||
}
|
||||
#elif ModernKeePassLibPCL
|
||||
#elif ModernKeePassLib
|
||||
public static IBitmap LoadImage(byte[] pb)
|
||||
{
|
||||
using (var ms = new MemoryStream(pb, false)) {
|
||||
|
@@ -29,7 +29,7 @@ using System.IO.Compression;
|
||||
using KeePassLibSD;
|
||||
#endif
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains static buffer manipulation and string conversion routines.
|
||||
|
@@ -24,10 +24,10 @@ using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
|
||||
using ModernKeePassLibPCL.Resources;
|
||||
using ModernKeePassLibPCL.Serialization;
|
||||
using ModernKeePassLib.Resources;
|
||||
using ModernKeePassLib.Serialization;
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
public sealed class MessageServiceEventArgs : EventArgs
|
||||
{
|
||||
|
@@ -25,9 +25,9 @@ using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
|
||||
using ModernKeePassLibPCL.Native;
|
||||
using ModernKeePassLib.Native;
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
public static class MonoWorkarounds
|
||||
{
|
||||
|
@@ -24,7 +24,7 @@ using System.Text;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
#if ModernKeePassLibPCL
|
||||
#if ModernKeePassLib
|
||||
using Windows.Security.Cryptography;
|
||||
#else
|
||||
using System.Security.Cryptography;
|
||||
@@ -32,13 +32,13 @@ using System.Security.Cryptography;
|
||||
using System.Globalization;
|
||||
using System.Diagnostics;
|
||||
|
||||
using ModernKeePassLibPCL.Collections;
|
||||
using ModernKeePassLibPCL.Cryptography.PasswordGenerator;
|
||||
using ModernKeePassLibPCL.Native;
|
||||
using ModernKeePassLibPCL.Security;
|
||||
using ModernKeePassLibPCL.Resources;
|
||||
using ModernKeePassLib.Collections;
|
||||
using ModernKeePassLib.Cryptography.PasswordGenerator;
|
||||
using ModernKeePassLib.Native;
|
||||
using ModernKeePassLib.Security;
|
||||
using ModernKeePassLib.Resources;
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Character stream class.
|
||||
@@ -223,7 +223,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
List<StrEncodingInfo> l = new List<StrEncodingInfo>();
|
||||
|
||||
l.Add(new StrEncodingInfo(StrEncodingType.Default,
|
||||
#if ModernKeePassLibPCL || KeePassRT
|
||||
#if ModernKeePassLib || KeePassRT
|
||||
StrUtil.Utf8.WebName, StrUtil.Utf8, 1, null));
|
||||
#else
|
||||
#if !KeePassLibSD
|
||||
@@ -234,7 +234,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
Encoding.Default,
|
||||
(uint)Encoding.Default.GetBytes("a").Length, null));
|
||||
#endif
|
||||
#if !ModernKeePassLibPCL && !KeePassRT
|
||||
#if !ModernKeePassLib && !KeePassRT
|
||||
l.Add(new StrEncodingInfo(StrEncodingType.Ascii,
|
||||
"ASCII", Encoding.ASCII, 1, null));
|
||||
l.Add(new StrEncodingInfo(StrEncodingType.Utf7,
|
||||
@@ -248,7 +248,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
l.Add(new StrEncodingInfo(StrEncodingType.Utf16BE,
|
||||
"Unicode (UTF-16 BE)", new UnicodeEncoding(true, false),
|
||||
2, new byte[] { 0xFE, 0xFF }));
|
||||
#if (!ModernKeePassLibPCL && !KeePassLibSD && !KeePassRT)
|
||||
#if (!ModernKeePassLib && !KeePassLibSD && !KeePassRT)
|
||||
l.Add(new StrEncodingInfo(StrEncodingType.Utf32LE,
|
||||
"Unicode (UTF-32 LE)", new UTF32Encoding(false, false),
|
||||
4, new byte[] { 0xFF, 0xFE, 0x0, 0x0 }));
|
||||
@@ -499,7 +499,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
if(excp.StackTrace != null)
|
||||
strText += excp.StackTrace + Environment.NewLine;
|
||||
#if !KeePassLibSD
|
||||
#if !ModernKeePassLibPCL && !KeePassRT
|
||||
#if !ModernKeePassLib && !KeePassRT
|
||||
if(excp.TargetSite != null)
|
||||
strText += excp.TargetSite.ToString() + MessageService.NewLine;
|
||||
#endif
|
||||
@@ -525,7 +525,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
if(excp.InnerException.StackTrace != null)
|
||||
strText += excp.InnerException.StackTrace + Environment.NewLine;
|
||||
#if !KeePassLibSD
|
||||
#if !ModernKeePassLibPCL && !KeePassRT
|
||||
#if !ModernKeePassLib && !KeePassRT
|
||||
if(excp.InnerException.TargetSite != null)
|
||||
strText += excp.InnerException.TargetSite.ToString();
|
||||
#endif
|
||||
@@ -778,7 +778,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
|
||||
if(m_rxNaturalSplit == null)
|
||||
m_rxNaturalSplit = new Regex(@"([0-9]+)",
|
||||
#if ModernKeePassLibPCL || KeePassRT
|
||||
#if ModernKeePassLib || KeePassRT
|
||||
RegexOptions.None);
|
||||
#else
|
||||
RegexOptions.Compiled);
|
||||
@@ -1192,7 +1192,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
byte[] pbEnc = ProtectedData.Protect(pbPlain, m_pbOptEnt,
|
||||
DataProtectionScope.CurrentUser);
|
||||
|
||||
#if (!ModernKeePassLibPCL && !KeePassLibSD && !KeePassRT)
|
||||
#if (!ModernKeePassLib && !KeePassLibSD && !KeePassRT)
|
||||
return Convert.ToBase64String(pbEnc, Base64FormattingOptions.None);
|
||||
#else
|
||||
return Convert.ToBase64String(pbEnc);
|
||||
@@ -1305,7 +1305,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
Array.Reverse(pb);
|
||||
for(int i = 0; i < pb.Length; ++i) pb[i] = (byte)(pb[i] ^ 0x65);
|
||||
|
||||
#if (!ModernKeePassLibPCL && !KeePassLibSD && !KeePassRT)
|
||||
#if (!ModernKeePassLib && !KeePassLibSD && !KeePassRT)
|
||||
return Convert.ToBase64String(pb, Base64FormattingOptions.None);
|
||||
#else
|
||||
return Convert.ToBase64String(pb);
|
||||
@@ -1465,7 +1465,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
|
||||
if(strMimeType == null) strMimeType = "application/octet-stream";
|
||||
|
||||
#if (!ModernKeePassLibPCL && !KeePassLibSD && !KeePassRT)
|
||||
#if (!ModernKeePassLib && !KeePassLibSD && !KeePassRT)
|
||||
return ("data:" + strMimeType + ";base64," + Convert.ToBase64String(
|
||||
pbData, Base64FormattingOptions.None));
|
||||
#else
|
||||
@@ -1496,7 +1496,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
#if ModernKeePassLibPCL || KeePassRT
|
||||
#if ModernKeePassLib || KeePassRT
|
||||
Encoding enc = StrUtil.Utf8;
|
||||
#else
|
||||
Encoding enc = Encoding.ASCII;
|
||||
|
@@ -23,9 +23,9 @@ using System.Text;
|
||||
using System.Globalization;
|
||||
using System.Diagnostics;
|
||||
|
||||
using ModernKeePassLibPCL.Interfaces;
|
||||
using ModernKeePassLib.Interfaces;
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains various static time structure manipulation and conversion
|
||||
|
@@ -24,14 +24,14 @@ using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
#if ModernKeePassLibPCL
|
||||
#if ModernKeePassLib
|
||||
//using PCLStorage;
|
||||
using Windows.Storage;
|
||||
#endif
|
||||
|
||||
using ModernKeePassLibPCL.Native;
|
||||
using ModernKeePassLib.Native;
|
||||
|
||||
namespace ModernKeePassLibPCL.Utility
|
||||
namespace ModernKeePassLib.Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// A class containing various static path utility helper methods (like
|
||||
@@ -41,7 +41,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
{
|
||||
private static readonly char[] m_vDirSeps = new char[] {
|
||||
'\\', '/', UrlUtil.LocalDirSepChar };
|
||||
#if !ModernKeePassLibPCL
|
||||
#if !ModernKeePassLib
|
||||
private static readonly char[] m_vPathTrimCharsWs = new char[] {
|
||||
'\"', ' ', '\t', '\r', '\n' };
|
||||
#endif
|
||||
@@ -50,7 +50,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
{
|
||||
#if KeePassRT
|
||||
get { return '\\'; }
|
||||
#elif ModernKeePassLibPCL
|
||||
#elif ModernKeePassLib
|
||||
//get { return PortablePath.DirectorySeparatorChar; }
|
||||
get { return '\\'; }
|
||||
#else
|
||||
@@ -267,7 +267,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
|
||||
public static bool UnhideFile(string strFile)
|
||||
{
|
||||
#if (ModernKeePassLibPCL || KeePassLibSD || KeePassRT)
|
||||
#if (ModernKeePassLib || KeePassLibSD || KeePassRT)
|
||||
return false;
|
||||
#else
|
||||
if(strFile == null) throw new ArgumentNullException("strFile");
|
||||
@@ -287,7 +287,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
|
||||
public static bool HideFile(string strFile, bool bHide)
|
||||
{
|
||||
#if (ModernKeePassLibPCL || KeePassLibSD || KeePassRT)
|
||||
#if (ModernKeePassLib || KeePassLibSD || KeePassRT)
|
||||
return false;
|
||||
#else
|
||||
if(strFile == null) throw new ArgumentNullException("strFile");
|
||||
@@ -328,7 +328,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
return strTargetFile;
|
||||
}
|
||||
|
||||
#if (!ModernKeePassLibPCL && !KeePassLibSD && !KeePassRT)
|
||||
#if (!ModernKeePassLib && !KeePassLibSD && !KeePassRT)
|
||||
if(NativeLib.IsUnix())
|
||||
#endif
|
||||
{
|
||||
@@ -361,7 +361,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
return sbRel.ToString();
|
||||
}
|
||||
|
||||
#if (!ModernKeePassLibPCL && !KeePassLibSD && !KeePassRT)
|
||||
#if (!ModernKeePassLib && !KeePassLibSD && !KeePassRT)
|
||||
try // Windows
|
||||
{
|
||||
const int nMaxPath = NativeMethods.MAX_PATH * 2;
|
||||
@@ -458,7 +458,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
var dirT = Windows.Storage.StorageFolder.GetFolderFromPathAsync(
|
||||
strPath).AwaitEx();
|
||||
str = dirT.Path;
|
||||
#elif ModernKeePassLibPCL
|
||||
#elif ModernKeePassLib
|
||||
var dirT = StorageFolder.GetFolderFromPathAsync(
|
||||
strPath).GetResults();
|
||||
str = dirT.Path;
|
||||
@@ -636,7 +636,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !ModernKeePassLibPCL
|
||||
#if !ModernKeePassLib
|
||||
public static string GetTempPath()
|
||||
{
|
||||
string strDir;
|
||||
@@ -659,7 +659,7 @@ namespace ModernKeePassLibPCL.Utility
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !ModernKeePassLibPCL && !KeePassLibSD
|
||||
#if !ModernKeePassLib && !KeePassLibSD
|
||||
// Structurally mostly equivalent to UrlUtil.GetFileInfos
|
||||
public static List<string> GetFilePaths(string strDir, string strPattern,
|
||||
SearchOption opt)
|
||||
|
Reference in New Issue
Block a user