From 4eced429816889ab22421be54f244bfe8f0f0ae4 Mon Sep 17 00:00:00 2001 From: Sean Kaim Date: Sun, 29 May 2016 21:35:41 -0400 Subject: [PATCH 1/3] Fix MR-840 (exception entering fullscreen) bug introduced as part of the C# conversion VB code: Public Fullscreen As New Misc.Fullscreen(Me) Private Sub mMenViewFullscreen_Click(sender As Object, e As EventArgs) Handles mMenViewFullscreen.Click Fullscreen.Value = Not Fullscreen.Value mMenViewFullscreen.Checked = Fullscreen.Value End Sub --- mRemoteV1/UI/Forms/frmMain.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 87b1b10dc..36d858766 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -37,7 +37,7 @@ namespace mRemoteNG.UI.Forms private bool _showFullPathInTitle; private ConnectionInfo _selectedConnection = null; private SystemMenu _systemMenu; - public MiscTools.Fullscreen _fullscreen; + private MiscTools.Fullscreen _fullscreen; @@ -45,6 +45,7 @@ namespace mRemoteNG.UI.Forms { _showFullPathInTitle = Settings.Default.ShowCompleteConsPathInTitle; InitializeComponent(); + _fullscreen = new MiscTools.Fullscreen(this); } static frmMain() From f0aaab12999958212d2a5f13c32f2145c6c69624 Mon Sep 17 00:00:00 2001 From: Sean Kaim Date: Sun, 29 May 2016 21:55:15 -0400 Subject: [PATCH 2/3] Fix MR-839 - correct cast --- mRemoteV1/UI/Forms/frmMain.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 36d858766..fcf717859 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -627,8 +627,8 @@ namespace mRemoteNG.UI.Forms private void ConnectionPanelMenuItem_Click(object sender, EventArgs e) { - ((BaseWindow) ((Control)sender).Tag).Show(pnlDock); - ((BaseWindow) ((Control)sender).Tag).Focus(); + ((BaseWindow) ((ToolStripMenuItem)sender).Tag).Show(pnlDock); + ((BaseWindow) ((ToolStripMenuItem)sender).Tag).Focus(); } private void mMenViewConnections_Click(object sender, EventArgs e) From 1560339377f62d17a60384ad76acffbe9b5d2a65 Mon Sep 17 00:00:00 2001 From: Sean Kaim Date: Sun, 29 May 2016 21:58:54 -0400 Subject: [PATCH 3/3] Fix MR-838 - correct cast --- mRemoteV1/UI/Forms/frmMain.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index fcf717859..23577ba45 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -956,9 +956,10 @@ namespace mRemoteNG.UI.Forms { if (e.Button == MouseButtons.Left) { - if (((Control)sender).Tag is ConnectionInfo) + var tag = ((ToolStripMenuItem)sender).Tag as ConnectionInfo; + if (tag != null) { - Runtime.OpenConnection((ConnectionInfo)((Control)sender).Tag); + Runtime.OpenConnection(tag); } } }