Skip to content

Commit 4abe92b

Browse files
committed
Added a default constructor in PwEntry
1 parent 860116b commit 4abe92b

File tree

6 files changed

+43
-12
lines changed

6 files changed

+43
-12
lines changed

KPCLib.xunit/PwDatabaseTests.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void IsOpenDbTest()
6161
}
6262

6363
[Fact]
64-
public void ListGroups()
64+
public void ListGroupsTests()
6565
{
6666
PwGroup pg = keepass.PwDb.RootGroup;
6767
foreach (var group in pg.Groups)
@@ -71,7 +71,7 @@ public void ListGroups()
7171
}
7272

7373
[Fact]
74-
public void ListEntries()
74+
public void ListEntriesTests()
7575
{
7676
PwGroup pg = keepass.PwDb.RootGroup;
7777
int count = 0;
@@ -85,5 +85,13 @@ public void ListEntries()
8585
}
8686
}
8787
}
88+
89+
[Fact]
90+
public void AddEntryTests()
91+
{
92+
var entry = new PwEntry();
93+
entry.Name = "New Entry";
94+
Debug.WriteLine($"Uuid={entry.Uuid}");
95+
}
8896
}
8997
}

KPCLib.xunit/PxDatabaseTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public void FindGroupByPathTests(string path)
224224
public void FindByPathDefaultTests()
225225
{
226226
Assert.Null(passxyz.PxDb.FindByPath<PwEntry>());
227-
Assert.Equal(passxyz.PxDb.FindByPath<PwGroup>().ToString(), passxyz.PxDb.RootGroup.ToString());
227+
Assert.Null(passxyz.PxDb.FindByPath<PwGroup>());
228228
}
229229

230230
[Fact]
@@ -248,7 +248,7 @@ public class PxLibInfoTests
248248
public void PxLibVersion()
249249
{
250250
Debug.WriteLine($"{PxLibInfo.Version}");
251-
Assert.Equal(PxLibInfo.Version, new System.Version("1.0.1.1"));
251+
Assert.Equal(PxLibInfo.Version, new System.Version("1.2.0.0"));
252252
}
253253

254254
[Fact]

KPCLib/KPCLib.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
<OutputType>Library</OutputType>
77
<StartupObject />
88
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9-
<Version>1.1.9</Version>
9+
<Version>1.2.0</Version>
1010
<PackageLicenseUrl>https://github.com/passxyz/KPCLib/blob/master/LICENSE</PackageLicenseUrl>
1111
<PackageProjectUrl>https://github.com/passxyz/KPCLib</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/passxyz/KPCLib</RepositoryUrl>
1313
<Description>This is the build of KeePassLib in Xamarin Portable Class Library. Three platforms, UWP, Android and iOS, are supported and tested.</Description>
1414
<Copyright>Dominik Reichl is the author of the original KeePassLib on Windows platform. Roger Ye created this for UWP, Android and iOS platforms.</Copyright>
1515
<Authors>Roger Ye</Authors>
16-
<Company>PassXYZ</Company>
17-
<PackageReleaseNotes>1.1.9 - Removed dependency Xamarin.Forms
16+
<Company>PassXYZ Inc.</Company>
17+
<PackageReleaseNotes>1.2.0 - Enhanced KeePassLib
18+
1.1.9 - Removed dependency Xamarin.Forms
1819
1.1.8 - Replaced Splat with SkiaSharp.
1920

2021
1.1.7 - Removed code refering to KeePassLibC32.dll.
2122

2223
1.1.6 - KPCLib has been tested on all three platforms (Android, iOS and UWP).</PackageReleaseNotes>
24+
<NeutralLanguage>en-US</NeutralLanguage>
2325
</PropertyGroup>
2426

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

KPCLib/PwEntry.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,31 @@ internal set
296296
public static EventHandler<ObjectTouchedEventArgs> EntryTouched;
297297
public EventHandler<ObjectTouchedEventArgs> Touched;
298298

299+
#if KPCLib
300+
/// <summary>
301+
/// The name of this group. Cannot be <c>null</c>.
302+
/// </summary>
303+
public string Name
304+
{
305+
get { return Strings.ReadSafe(PwDefs.TitleField); }
306+
set
307+
{
308+
if (value == null) { Debug.Assert(false); throw new ArgumentNullException("value"); }
309+
Strings.Set(PwDefs.TitleField, new ProtectedString(
310+
false, value));
311+
}
312+
}
313+
299314
public PwEntry()
300315
{
301316
DateTime dtNow = DateTime.UtcNow;
302317
m_tCreation = dtNow;
303318
m_tLastMod = dtNow;
304319
m_tLastAccess = dtNow;
305320
m_tParentGroupLastMod = dtNow;
321+
m_uuid = new PwUuid(true);
306322
}
307-
323+
#endif
308324
/// <summary>
309325
/// Construct a new, empty password entry. Member variables will be initialized
310326
/// to their default values.

MergeList.xlsx

19 Bytes
Binary file not shown.

PassXYZLib/PassXYZLib.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<Version>1.0.1</Version>
6-
<AssemblyVersion>1.0.1.1</AssemblyVersion>
7-
<FileVersion>1.0.1.1</FileVersion>
5+
<Version>1.2.0</Version>
6+
<AssemblyVersion>1.2.0.0</AssemblyVersion>
7+
<FileVersion>1.2.0.0</FileVersion>
88
<Company>PassXYZ Inc.</Company>
99
<Authors>Roger Ye</Authors>
10+
<Copyright>Roger Ye</Copyright>
11+
<PackageReleaseNotes>1.2.0 - Updated to KeePassLib 2.4.7. Enhanced KeePassLib</PackageReleaseNotes>
12+
<PackageProjectUrl>https://github.com/passxyz/KPCLib</PackageProjectUrl>
13+
<RepositoryUrl>https://github.com/passxyz/KPCLib</RepositoryUrl>
14+
<NeutralLanguage>en-US</NeutralLanguage>
1015
</PropertyGroup>
1116

1217
<ItemGroup>

0 commit comments

Comments
 (0)