void LoadBookmarks() { using (new ScopedGuard(() => loadingLogSourceInfoFromStorageEntry = true, () => loadingLogSourceInfoFromStorageEntry = false)) using (var section = logSourceSpecificStorageEntry.OpenXMLSection("bookmarks", Persistence.StorageSectionOpenFlag.ReadOnly)) { var root = section.Data.Element("bookmarks"); if (root == null) { return; } foreach (var elt in root.Elements("bookmark")) { var time = elt.Attribute("time"); var thread = elt.Attribute("thread-id"); var name = elt.Attribute("display-name"); var position = elt.Attribute("position"); var lineIndex = elt.Attribute("line-index"); if (time != null && thread != null && name != null && position != null) { bookmarks.ToggleBookmark(bookmarks.Factory.CreateBookmark( MessageTimestamp.ParseFromLoselessFormat(time.Value), logSourceThreads.GetThread(new StringSlice(thread.Value)), name.Value, long.Parse(position.Value), (lineIndex != null) ? int.Parse(lineIndex.Value) : 0 )); } } } }
void IViewEvents.OnToggleBookmark() { bookmarks.ToggleBookmark(messagesPresenter.GetFocusedMessageBookmark()); }