Entries now have working expiration dates

About page redone (with working hyperlink)
WIP on how to display that info on the group detail page
This commit is contained in:
2017-10-18 18:49:02 +02:00
committed by BONNEVILLE Geoffroy
parent 7bb78fd374
commit 66fd87124b
6 changed files with 49 additions and 15 deletions

View File

@@ -73,7 +73,7 @@ namespace ModernKeePass.ViewModels
get
{
if (Entry == null) return Symbol.Add;
//if ()
if (HasExpired) return Symbol.Priority;
var result = PwIconToSegoeMapping.GetSymbolFromIcon(Entry.IconId);
return result == Symbol.More ? Symbol.Permissions : result;
}
@@ -82,12 +82,12 @@ namespace ModernKeePass.ViewModels
public DateTimeOffset ExpiryDate
{
get { return new DateTimeOffset(Entry.ExpiryTime.Date); }
set { Entry.ExpiryTime = value.DateTime; }
set { if (HasExpirationDate) Entry.ExpiryTime = value.DateTime; }
}
public TimeSpan ExpiryTime
{
get { return Entry.ExpiryTime.TimeOfDay; }
set { Entry.ExpiryTime = Entry.ExpiryTime.Date.Add(value); }
set { if (HasExpirationDate) Entry.ExpiryTime = Entry.ExpiryTime.Date.Add(value); }
}
public bool IsEditMode
@@ -118,6 +118,10 @@ namespace ModernKeePass.ViewModels
NotifyPropertyChanged("HasExpirationDate");
}
}
public bool HasExpired
{
get { return HasExpirationDate && Entry.ExpiryTime < DateTime.Now; }
}
public event PropertyChangedEventHandler PropertyChanged;