Exemplo n.º 1
0
        private void updateLastEdited(string newBookMark)
        {
            var group   = returnGroup();
            var oldNote = string.Empty;

            try
            {
                KeePassLib.Collections.PwObjectList <PwEntry> group_entries = group.GetEntries(false);

                for (uint i = 0; i < group_entries.UCount; i++)
                {
                    if (group_entries.GetAt(i).Strings.Get(PwDefs.TitleField).ReadString() == KEEBOOK_LAST_EDITED_NAME)
                    {
                        oldNote = group_entries.GetAt(i).Strings.Get(PwDefs.NotesField).ReadString();
                        group.Entries.RemoveAt(i);
                    }
                }

                PwGroup pwgroup = returnGroup();
                PwEntry pwe     = new PwEntry(true, true);
                pwe.CustomIconUuid = getKeeBookIcon().Uuid;
                pwe.Strings.Set(PwDefs.TitleField, new ProtectedString(false, KEEBOOK_LAST_EDITED_NAME));
                pwe.Strings.Set(PwDefs.UserNameField, new ProtectedString(false, LongUtcDateIso8601() + "   (Utc date)"));
                pwe.Strings.Set(PwDefs.NotesField, new ProtectedString(true, oldNote + Environment.NewLine + newBookMark));
                pwgroup.AddEntry(pwe, true);
            }
            catch (Exception ex)
            {
                showError(ex);
            }
        }