Skip to content

Commit 02ca07c

Browse files
committed
Moved GetUsersList() to Class User
1 parent 11d8d06 commit 02ca07c

File tree

8 files changed

+32
-31
lines changed

8 files changed

+32
-31
lines changed

KPCLib.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>KPCLib</id>
5-
<version>1.3.0.0</version>
5+
<version>1.3.1.0</version>
66
<authors>Roger Ye</authors>
77
<owners>Roger Ye</owners>
88
<requireLicenseAcceptance>false</requireLicenseAcceptance>

KPCLib.xunit/PxDatabaseTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public class PxLibInfoTests
392392
public void PxLibVersion()
393393
{
394394
Debug.WriteLine($"{PxLibInfo.Version}");
395-
Assert.Equal(PxLibInfo.Version, new System.Version("1.3.0.0"));
395+
Assert.Equal(PxLibInfo.Version, new System.Version("1.3.1.0"));
396396
}
397397

398398
[Fact]

KPCLib.xunit/UserTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void KeyPathTest()
6363
[Fact]
6464
public void GetUserNameTest()
6565
{
66-
PxDataFile.GetUsersList();
66+
User.GetUsersList();
6767
}
6868

6969
[Fact]

KPCLib.xunit/pass_d_E8f4pEk.xyz

352 Bytes
Binary file not shown.

KPCLib/KPCLib.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<OutputType>Library</OutputType>
77
<StartupObject />
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9-
<Version>1.3.0.0</Version>
9+
<Version>1.3.1.0</Version>
1010
<PackageProjectUrl>https://github.com/passxyz/KPCLib</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/passxyz/KPCLib</RepositoryUrl>
1212
<Description>This is the build of KeePassLib in Xamarin Portable Class Library. Three platforms, UWP, Android and iOS, are supported and tested.</Description>
@@ -17,8 +17,8 @@
1717
- Updated to KeePass 2.48.1
1818
- Fixed an issue in CryptoRandom.cs</PackageReleaseNotes>
1919
<NeutralLanguage>en-US</NeutralLanguage>
20-
<AssemblyVersion>1.3.0.0</AssemblyVersion>
21-
<FileVersion>1.3.0.0</FileVersion>
20+
<AssemblyVersion>1.3.1.0</AssemblyVersion>
21+
<FileVersion>1.3.1.0</FileVersion>
2222
</PropertyGroup>
2323

2424
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

PassXYZLib.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata>
44
<id>PassXYZLib</id>
5-
<version>1.3.0.0</version>
5+
<version>1.3.1.0</version>
66
<authors>Roger Ye</authors>
77
<owners>Roger Ye</owners>
88
<requireLicenseAcceptance>false</requireLicenseAcceptance>
@@ -24,7 +24,7 @@
2424
<dependency id="Xamarin.Forms.FontAwesome.Brand" version="1.0.0" exclude="Build,Analyzers" />
2525
<dependency id="Xamarin.Forms.FontAwesome.Regular" version="1.0.0" exclude="Build,Analyzers" />
2626
<dependency id="Xamarin.Forms.FontAwesome.Solid" version="1.0.0" exclude="Build,Analyzers" />
27-
<dependency id="KPCLib" version="1.3.0.0" exclude="Build,Analyzers" />
27+
<dependency id="KPCLib" version="1.3.1.0" exclude="Build,Analyzers" />
2828
</group>
2929
</dependencies>
3030
<summary>PassXYZLib added additional features for Xamarin Forms.</summary>

PassXYZLib/PassXYZLib.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Version>1.3.0.0</Version>
6-
<AssemblyVersion>1.3.0.0</AssemblyVersion>
7-
<FileVersion>1.3.0.0</FileVersion>
5+
<Version>1.3.1.0</Version>
6+
<AssemblyVersion>1.3.1.0</AssemblyVersion>
7+
<FileVersion>1.3.1.0</FileVersion>
88
<Company>PassXYZ Inc.</Company>
99
<Authors>Roger Ye</Authors>
1010
<Copyright>Roger Ye</Copyright>

PassXYZLib/User.cs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,6 @@ public static string GetUserName(string fileName)
7070
return trimedName;
7171
}
7272

73-
/// <summary>
74-
/// Get a list of existing users from the encoded data files
75-
/// </summary>
76-
/// <returns>user list</returns>
77-
public static List<string> GetUsersList()
78-
{
79-
List<string> userList = new List<string>();
80-
81-
var dataFiles = Directory.EnumerateFiles(DataFilePath, PxDefs.all_xyz);
82-
foreach (string currentFile in dataFiles)
83-
{
84-
string fileName = currentFile.Substring(DataFilePath.Length + 1);
85-
string userName = GetUserName(fileName);
86-
if (userName != string.Empty && !string.IsNullOrWhiteSpace(userName))
87-
{
88-
userList.Add(userName);
89-
}
90-
}
91-
return userList;
92-
}
9373
}
9474

9575
public class User
@@ -202,6 +182,27 @@ private string GetFileName(bool isDeviceLockEnabled = false)
202182
}
203183
}
204184

185+
/// <summary>
186+
/// Get a list of existing users from the encoded data files
187+
/// </summary>
188+
/// <returns>user list</returns>
189+
public static List<string> GetUsersList()
190+
{
191+
List<string> userList = new List<string>();
192+
193+
var dataFiles = Directory.EnumerateFiles(PxDataFile.DataFilePath, PxDefs.all_xyz);
194+
foreach (string currentFile in dataFiles)
195+
{
196+
string fileName = currentFile.Substring(PxDataFile.DataFilePath.Length + 1);
197+
string userName = PxDataFile.GetUserName(fileName);
198+
if (userName != string.Empty && !string.IsNullOrWhiteSpace(userName))
199+
{
200+
userList.Add(userName);
201+
}
202+
}
203+
return userList;
204+
}
205+
205206
public User()
206207
{
207208
IsDeviceLockEnabled = false;

0 commit comments

Comments
 (0)