private void listBox1_DrawItem(object sender, DrawItemEventArgs e) { if ((e.State & DrawItemState.Selected) != 0) { e.Graphics.FillRectangle(SMGraphics.GetBrush(Color.LightBlue), e.Bounds); } else { e.Graphics.FillRectangle(SMGraphics.GetBrush(listBox1.BackColor), e.Bounds); } MNBookHeader bh = GetBookAtIndex(e.Index); if (bh == null) { return; } Rectangle r = new Rectangle(e.Bounds.Left + 4, e.Bounds.Top + 4, e.Bounds.Height - 8, e.Bounds.Height - 8); e.Graphics.FillRectangle(SMGraphics.GetBrush(bh.BookColor), r); e.Graphics.DrawRectangle(Pens.Black, r); r = new Rectangle(e.Bounds.Left + e.Bounds.Height + 16, e.Bounds.Top, e.Bounds.Width - e.Bounds.Height - 16, e.Bounds.Height); e.Graphics.DrawString(bh.BookTitle, SMGraphics.GetFontVariation(MNFontName.LucidaSans, 12f), SMGraphics.GetBrush(listBox1.ForeColor), r, SMGraphics.StrFormatLeftCenter); }
private void ViewFrame_FormClosing(object sender, FormClosingEventArgs e) { ReviewFrame.Shared.OnNotificationReceived(this, "StopDocumentReview"); ReviewFrame.Shared.SavePosition(); this.SavePosition(); SMGraphics.RemoveAddedFonts(); ErrorCatcher.Save(); }