code clean up

This commit is contained in:
Sean Kaim
2018-07-27 16:45:38 -04:00
parent 0d2d935f17
commit 9e95ae2cb0
4 changed files with 7 additions and 6 deletions

View File

@@ -73,7 +73,7 @@ namespace mRemoteNG.UI.Controls.Base
else
e.Graphics.FillRectangle(new SolidBrush(_themeManager.ActiveTheme.ExtendedPalette.getColor("ComboBox_Background")), e.Bounds);
if(DisplayMember == null || DisplayMember == "")
if(string.IsNullOrEmpty(DisplayMember))
e.Graphics.DrawString(Items[index].ToString(), e.Font, itemBrush, e.Bounds, StringFormat.GenericDefault);
else
{
@@ -129,7 +129,7 @@ namespace mRemoteNG.UI.Controls.Base
}
//Arrow
e.Graphics.DrawString("\u25BC", this.Font, new SolidBrush(ButtFore), Width-17, Height/2 -5);
e.Graphics.DrawString("\u25BC", Font, new SolidBrush(ButtFore), Width-17, Height/2 -5);
//Text
var textRect = new Rectangle(2, 2, Width - 20, Height - 4);

View File

@@ -10,7 +10,7 @@ namespace mRemoteNG.UI.Controls.Base
{
private ThemeManager _themeManager;
public NGGroupBox() : base()
public NGGroupBox()
{
ThemeManager.getInstance().ThemeChanged += OnCreateControl;
}

View File

@@ -42,12 +42,12 @@ namespace mRemoteNG.UI.Controls.Base
e.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
if (Enabled)
{
TextRenderer.DrawText(e.Graphics, this.Text, Font, ClientRectangle, ForeColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
TextRenderer.DrawText(e.Graphics, Text, Font, ClientRectangle, ForeColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
}
else
{
var disabledtextLabel = _themeManager.ActiveTheme.ExtendedPalette.getColor("TextBox_Disabled_Foreground");
TextRenderer.DrawText(e.Graphics, this.Text, Font, ClientRectangle, disabledtextLabel, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
TextRenderer.DrawText(e.Graphics, Text, Font, ClientRectangle, disabledtextLabel, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
}
}

View File

@@ -2,6 +2,7 @@
using System.Drawing;
using System.Windows.Forms;
using mRemoteNG.Themes;
// ReSharper disable LocalizableElement
namespace mRemoteNG.UI.Controls.Base
{
@@ -14,7 +15,7 @@ namespace mRemoteNG.UI.Controls.Base
private NGButton Up;
private NGButton Down;
public NGNumericUpDown() : base()
public NGNumericUpDown()
{
_themeManager = ThemeManager.getInstance();
ThemeManager.getInstance().ThemeChanged += OnCreateControl;