From f852a4d34140474ad7031d1218adac2e79cb56c4 Mon Sep 17 00:00:00 2001 From: Sean Kaim Date: Fri, 27 Jul 2018 17:02:51 -0400 Subject: [PATCH] minor code clean up --- .../Resources/Language/Language.Designer.cs | 18 ++++++++++++++++++ mRemoteV1/Resources/Language/Language.resx | 6 ++++++ mRemoteV1/UI/Controls/IPTextBox.cs | 15 +++++---------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/mRemoteV1/Resources/Language/Language.Designer.cs b/mRemoteV1/Resources/Language/Language.Designer.cs index e93828e7..95c166a8 100644 --- a/mRemoteV1/Resources/Language/Language.Designer.cs +++ b/mRemoteV1/Resources/Language/Language.Designer.cs @@ -2777,6 +2777,15 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Must Be Between 0 and 255. + /// + internal static string strIPRange { + get { + return ResourceManager.GetString("strIPRange", resourceCulture); + } + } + /// /// Looks up a localized string similar to CTRL-ALT-DEL. /// @@ -4308,6 +4317,15 @@ namespace mRemoteNG { } } + /// + /// Looks up a localized string similar to Out Of Range. + /// + internal static string strOutOfRange { + get { + return ResourceManager.GetString("strOutOfRange", resourceCulture); + } + } + /// /// Looks up a localized string similar to Panel Name. /// diff --git a/mRemoteV1/Resources/Language/Language.resx b/mRemoteV1/Resources/Language/Language.resx index f1aae0d9..70b6afb1 100644 --- a/mRemoteV1/Resources/Language/Language.resx +++ b/mRemoteV1/Resources/Language/Language.resx @@ -2679,4 +2679,10 @@ This page will walk you through the process of upgrading your connections file o Create an empty panel when mRemoteNG starts + + Must Be Between 0 and 255 + + + Out Of Range + \ No newline at end of file diff --git a/mRemoteV1/UI/Controls/IPTextBox.cs b/mRemoteV1/UI/Controls/IPTextBox.cs index 0634c76b..7dad5a66 100644 --- a/mRemoteV1/UI/Controls/IPTextBox.cs +++ b/mRemoteV1/UI/Controls/IPTextBox.cs @@ -29,9 +29,8 @@ namespace mRemoteNG.UI.Controls /** Sets and Gets the tooltiptext on toolTip1 */ public string ToolTipText { - get - { return toolTip1.GetToolTip(Octet1); } - set + get => toolTip1.GetToolTip(Octet1); + set { toolTip1.SetToolTip(Octet1,value); toolTip1.SetToolTip(Octet2,value); @@ -46,12 +45,8 @@ namespace mRemoteNG.UI.Controls /** Set or Get the string that represents the value in the box */ public override string Text { - get - { - return Octet1.Text + @"." + Octet2.Text + @"." + Octet3.Text + @"." + Octet4.Text; - - } - set + get => Octet1.Text + @"." + Octet2.Text + @"." + Octet3.Text + @"." + Octet4.Text; + set { if (!string.IsNullOrEmpty(value)) { @@ -245,7 +240,7 @@ namespace mRemoteNG.UI.Controls if(theValue >=0 && theValue <= 255) return true; - MessageBox.Show("Must Be Between 0 and 255","Out Of Range"); + MessageBox.Show(Language.strIPRange,Language.strOutOfRange); return false; } catch