Beispiel #1
0
 private void cbRepository_DrawItem(object sender, DrawItemEventArgs e)
 {
     if (e.Index >= 0 && cbRepository.Items[e.Index] is ILocalizationRepository drawRepository)
     {
         bool isInstalled = _controller.IsRepositoryInstalled(drawRepository);
         using var brush = new SolidBrush(isInstalled ? e.ForeColor : Color.Gray);
         using var font  = new Font(e.Font, isInstalled ? FontStyle.Bold : FontStyle.Regular);
         e.DrawBackground();
         e.Graphics.DrawString(drawRepository.Name, font, brush, e.Bounds);
         e.DrawFocusRectangle();
     }
 }