private static Image GetVerseBookmarkImage(int bibleId, string verseKey) { string bibleKey = Formatters.IsBiblesKey(verseKey) ? verseKey : $"{bibleId}||{verseKey}"; BookmarkModel model = BiblesData.Database.GetBookmark(bibleKey); if (model == null) { return(null); } ModelsBookmark bookmark = model.CopyToObject(new ModelsBookmark()).To <ModelsBookmark>(); string imgToolTip = bookmark.BookMarkName.IsNullEmptyOrWhiteSpace() && bookmark.Description.IsNullEmptyOrWhiteSpace() ? bookmark.SelectedVerse : bookmark.BookMarkName.IsNullEmptyOrWhiteSpace() ? $"{bookmark.SelectedVerse}{Environment.NewLine}{bookmark.Description}" : $"{bookmark.SelectedVerse}{Environment.NewLine}{bookmark.BookMarkName}{Environment.NewLine}{Environment.NewLine}{bookmark.Description}"; Image img = new Image { Source = IconSets.ResourceImageSource("BookmarkSmall", 16), ToolTip = imgToolTip, Opacity = 0.5, Tag = bibleKey }; img.PreviewMouseLeftButtonUp += BibleLoader.Bookmark_Selected; return(img); }
private static Image GetLinkImage(string verseKey) { if (!BiblesData.Database.HaveLink(verseKey)) { return(null); } Image linkImage = new Image { Source = IconSets.ResourceImageSource("Link", 16), Opacity = 0.5, Tag = verseKey }; linkImage.PreviewMouseLeftButtonUp += BibleLoader.LinkImage_Selected; return(linkImage); }
private void DirectionButton_Loaded(object sender, System.Windows.RoutedEventArgs e) { switch (this.Direction) { case DirectionsEnum.Left: this.Content = new Image() { Source = IconSets.ResourceImageSource("ArrowLeft", this.Scale) }; break; case DirectionsEnum.Right: this.Content = new Image() { Source = IconSets.ResourceImageSource("ArrowRight", this.Scale) }; break; case DirectionsEnum.Up: this.Content = new Image() { Source = IconSets.ResourceImageSource("ArrowUp", this.Scale) }; break; case DirectionsEnum.Down: this.Content = new Image() { Source = IconSets.ResourceImageSource("ArrowDown", this.Scale) }; break; default: break; } }
private static Image GetStudyBookmarkImage(int bibleId, string verseKey) { string bibleKey = Formatters.IsBiblesKey(verseKey) ? verseKey : $"{bibleId}||{verseKey}"; List <StudyBookmarkModel> modelsList = BiblesData.Database.GetStudyBookmarks(bibleKey); if (modelsList.Count <= 0) { return(null); } Image img = new Image { Source = IconSets.ResourceImageSource("BookmarkSmallRed", 16), Opacity = 0.5 }; ContextMenu bookmarkMenu = new ContextMenu(); StringBuilder imageTooltip = new StringBuilder(); imageTooltip.AppendLine("(Right Click to Edit)"); foreach (StudyBookmarkModel studyMark in modelsList) { MenuItem menuItem = new MenuItem { Header = studyMark.StudyName, Tag = studyMark.StudyVerseKey }; menuItem.Click += BibleLoader.StudyBookmark_Selected; bookmarkMenu.Items.Add(menuItem); imageTooltip.AppendLine(studyMark.StudyName); } img.ContextMenu = bookmarkMenu; img.ToolTip = imageTooltip.ToString(); return(img); }
private static Image GetNotesImage(string bibleVerseKey) { VerseNotesModel noteModel = BiblesData.Database.GetVerseNotes(bibleVerseKey); if (noteModel == null) { return(null); } Image linkImage = new Image { Source = IconSets.ResourceImageSource("Notes", 16), Opacity = 0.5, Tag = bibleVerseKey, ToolTip = new TooltipLabel { Text = noteModel.FootNote.UnzipFile().ParseToString() } }; linkImage.PreviewMouseLeftButtonUp += BibleLoader.VerseNote_Selected; return(linkImage); }
public ReportImage() { this.ElemntId = Guid.NewGuid(); this.Source = IconSets.ResourceImageSource("DefaultImage", 25); }