MR-364 - remove announcements

And some code clean up
This commit is contained in:
Sean Kaim
2016-10-10 15:23:55 -04:00
parent 41fcbb2989
commit 1ea0522fcb
11 changed files with 53 additions and 470 deletions

View File

@@ -21,14 +21,10 @@ namespace mRemoteNG.App
{
public class Startup
{
private static readonly Startup _singletonInstance = new Startup();
private CompatibilityChecker _compatibilityChecker;
private AppUpdater _appUpdate;
public static Startup Instance
{
get { return _singletonInstance; }
}
public static Startup Instance { get; } = new Startup();
private Startup()
{
@@ -242,48 +238,6 @@ namespace mRemoteNG.App
}
}
private void CheckForAnnouncement()
{
if (_appUpdate == null)
_appUpdate = new AppUpdater();
else if (_appUpdate.IsGetAnnouncementInfoRunning)
return;
_appUpdate.GetAnnouncementInfoCompletedEvent += GetAnnouncementInfoCompleted;
_appUpdate.GetAnnouncementInfoAsync();
}
private void GetAnnouncementInfoCompleted(object sender, AsyncCompletedEventArgs e)
{
if (frmMain.Default.InvokeRequired)
{
frmMain.Default.Invoke(new AsyncCompletedEventHandler(GetAnnouncementInfoCompleted), new object[] { sender, e });
return;
}
try
{
_appUpdate.GetAnnouncementInfoCompletedEvent -= GetAnnouncementInfoCompleted;
if (e.Cancelled)
{
return;
}
if (e.Error != null)
{
throw (e.Error);
}
if (_appUpdate.IsAnnouncementAvailable())
{
Windows.Show(WindowType.Announcement);
}
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage("GetAnnouncementInfoCompleted() failed.", ex, MessageClass.ErrorMsg, true);
}
}
private void ParseCommandLineArgs()
{

View File

@@ -15,61 +15,30 @@ namespace mRemoteNG.App.Update
{
private UpdateInfo _currentUpdateInfo;
private string _changeLog;
private AnnouncementInfo _currentAnnouncementInfo;
private WebProxy _webProxy;
private Thread _getUpdateInfoThread;
private Thread _getChangeLogThread;
private Thread _getAnnouncementInfoThread;
#region Public Properties
public UpdateInfo CurrentUpdateInfo => _currentUpdateInfo;
public string ChangeLog => _changeLog;
public AnnouncementInfo CurrentAnnouncementInfo => _currentAnnouncementInfo;
public bool IsGetUpdateInfoRunning
{
get
{
if (_getUpdateInfoThread != null)
{
if (_getUpdateInfoThread.IsAlive)
{
return true;
}
}
return false;
if (_getUpdateInfoThread == null) return false;
return _getUpdateInfoThread.IsAlive;
}
}
public bool IsGetChangeLogRunning
private bool IsGetChangeLogRunning
{
get
{
if (_getChangeLogThread != null)
{
if (_getChangeLogThread.IsAlive)
{
return true;
}
}
return false;
}
}
public bool IsGetAnnouncementInfoRunning
{
get
{
if (_getAnnouncementInfoThread != null)
{
if (_getAnnouncementInfoThread.IsAlive)
{
return true;
}
}
return false;
if (_getChangeLogThread == null) return false;
return _getChangeLogThread.IsAlive;
}
}
@@ -120,16 +89,6 @@ namespace mRemoteNG.App.Update
return _currentUpdateInfo.Version > GeneralAppInfo.getVer();
}
public bool IsAnnouncementAvailable()
{
if (_currentAnnouncementInfo == null || (!_currentAnnouncementInfo.IsValid || string.IsNullOrEmpty(_currentAnnouncementInfo.Name)))
{
return false;
}
return (_currentAnnouncementInfo.Name != Settings.Default.LastAnnouncement);
}
public void GetUpdateInfoAsync()
{
if (IsGetUpdateInfoRunning)
@@ -161,19 +120,6 @@ namespace mRemoteNG.App.Update
_getChangeLogThread.Start();
}
public void GetAnnouncementInfoAsync()
{
if (IsGetAnnouncementInfoRunning)
{
_getAnnouncementInfoThread.Abort();
}
_getAnnouncementInfoThread = new Thread(GetAnnouncementInfo);
_getAnnouncementInfoThread.SetApartmentState(ApartmentState.STA);
_getAnnouncementInfoThread.IsBackground = true;
_getAnnouncementInfoThread.Start();
}
public void DownloadUpdateAsync()
{
if (_downloadUpdateWebClient != null)
@@ -286,24 +232,6 @@ namespace mRemoteNG.App.Update
GetChangeLogCompletedEventEvent?.Invoke(this, e);
}
private void GetAnnouncementInfo()
{
Uri announcementFileUri = new Uri(Convert.ToString(Settings.Default.AnnouncementAddress));
DownloadStringCompletedEventArgs e = DownloadString(announcementFileUri);
if (!e.Cancelled && e.Error == null)
{
_currentAnnouncementInfo = AnnouncementInfo.FromString(e.Result);
if (!string.IsNullOrEmpty(_currentAnnouncementInfo.Name))
{
Settings.Default.LastAnnouncement = _currentAnnouncementInfo.Name;
}
}
GetAnnouncementInfoCompletedEventEvent?.Invoke(this, e);
}
private void DownloadUpdateProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
DownloadUpdateProgressChangedEventEvent?.Invoke(sender, e);
@@ -317,21 +245,22 @@ namespace mRemoteNG.App.Update
{
try
{
Authenticode updateAuthenticode = new Authenticode(_currentUpdateInfo.UpdateFilePath);
updateAuthenticode.RequireThumbprintMatch = true;
updateAuthenticode.ThumbprintToMatch = _currentUpdateInfo.CertificateThumbprint;
if (updateAuthenticode.Verify() != Authenticode.StatusValue.Verified)
{
if (updateAuthenticode.Status == Authenticode.StatusValue.UnhandledException)
Authenticode updateAuthenticode = new Authenticode(_currentUpdateInfo.UpdateFilePath)
{
// I'm guessing that this is going to prevent 1.72 from auto updating to 1.74+
RequireThumbprintMatch = true,
ThumbprintToMatch = _currentUpdateInfo.CertificateThumbprint
};
if (updateAuthenticode.Verify() != Authenticode.StatusValue.Verified)
{
if (updateAuthenticode.Status == Authenticode.StatusValue.UnhandledException)
{
throw (updateAuthenticode.Exception);
}
else
{
throw (new Exception(updateAuthenticode.StatusMessage));
}
}
throw (new Exception(updateAuthenticode.StatusMessage));
}
}
catch (Exception ex)
{

View File

@@ -31,8 +31,6 @@ namespace mRemoteNG.App
public static DockContent ErrorsPanel { get; set; } = new DockContent();
public static ScreenshotManagerWindow ScreenshotForm { get; set; }
public static DockContent ScreenshotPanel { get; set; } = new DockContent();
public static AnnouncementWindow AnnouncementForm { get; set; }
public static DockContent AnnouncementPanel { get; set; } = new DockContent();
public static UpdateWindow UpdateForm { get; set; }
public static DockContent UpdatePanel { get; set; } = new DockContent();
public static SSHTransferWindow SshtransferForm { get; set; }
@@ -124,15 +122,6 @@ namespace mRemoteNG.App
}
_componentscheckForm.Show(frmMain.Default.pnlDock);
}
else if (windowType.Equals(WindowType.Announcement))
{
if (AnnouncementForm == null || AnnouncementForm.IsDisposed)
{
AnnouncementForm = new AnnouncementWindow(AnnouncementPanel);
AnnouncementPanel = AnnouncementForm;
}
AnnouncementForm.Show(frmMain.Default.pnlDock);
}
}
catch (Exception ex)
{

View File

@@ -1,6 +1,5 @@
using mRemoteNG.App;
using mRemoteNG.App.Info;
using mRemoteNG.Tree;
using mRemoteNG.UI.Forms;
using mRemoteNG.UI.Window;
using System;
@@ -86,7 +85,7 @@ namespace mRemoteNG.Config.Settings
return null;
}
public void CreatePanels()
private void CreatePanels()
{
Windows.ConfigForm = new ConfigWindow(Windows.ConfigPanel);
Windows.ConfigPanel = Windows.ConfigForm;
@@ -102,9 +101,6 @@ namespace mRemoteNG.Config.Settings
Windows.UpdateForm = new UpdateWindow(Windows.UpdatePanel);
Windows.UpdatePanel = Windows.UpdateForm;
Windows.AnnouncementForm = new AnnouncementWindow(Windows.AnnouncementPanel);
Windows.AnnouncementPanel = Windows.AnnouncementForm;
}
}
}

View File

@@ -67,8 +67,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
this.lblUpdatesExplanation.Name = "lblUpdatesExplanation";
this.lblUpdatesExplanation.Size = new System.Drawing.Size(536, 40);
this.lblUpdatesExplanation.TabIndex = 3;
this.lblUpdatesExplanation.Text = "mRemoteNG can periodically connect to the mRemoteNG website to check for updates " +
"and product announcements.";
this.lblUpdatesExplanation.Text = "mRemoteNG can periodically connect to the mRemoteNG website to check for updates.";
//
//pnlUpdateCheck
//
@@ -96,7 +95,7 @@ namespace mRemoteNG.UI.Forms.OptionsPages
this.chkCheckForUpdatesOnStartup.Name = "chkCheckForUpdatesOnStartup";
this.chkCheckForUpdatesOnStartup.Size = new System.Drawing.Size(213, 17);
this.chkCheckForUpdatesOnStartup.TabIndex = 0;
this.chkCheckForUpdatesOnStartup.Text = "Check for updates and announcements";
this.chkCheckForUpdatesOnStartup.Text = "Check for updates";
this.chkCheckForUpdatesOnStartup.UseVisualStyleBackColor = true;
//
//cboUpdateCheckFrequency

View File

@@ -88,7 +88,6 @@ namespace mRemoteNG.UI.Forms
this.mMenInfoForum = new System.Windows.Forms.ToolStripMenuItem();
this.mMenInfoBugReport = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.mMenInfoAnnouncements = new System.Windows.Forms.ToolStripMenuItem();
this.mMenToolsUpdate = new System.Windows.Forms.ToolStripMenuItem();
this.mMenInfoSep2 = new System.Windows.Forms.ToolStripSeparator();
this.mMenInfoAbout = new System.Windows.Forms.ToolStripMenuItem();
@@ -143,10 +142,10 @@ namespace mRemoteNG.UI.Forms
this.mMenView,
this.mMenTools,
this.mMenInfo});
this.msMain.Location = new System.Drawing.Point(5, 0);
this.msMain.Location = new System.Drawing.Point(3, 0);
this.msMain.Name = "msMain";
this.msMain.Padding = new System.Windows.Forms.Padding(2, 2, 0, 2);
this.msMain.Size = new System.Drawing.Size(269, 24);
this.msMain.Size = new System.Drawing.Size(176, 24);
this.msMain.Stretch = false;
this.msMain.TabIndex = 16;
this.msMain.Text = "Main Toolbar";
@@ -363,7 +362,7 @@ namespace mRemoteNG.UI.Forms
//
this.mMenViewAddConnectionPanel.Image = global::mRemoteNG.Resources.Panel_Add;
this.mMenViewAddConnectionPanel.Name = "mMenViewAddConnectionPanel";
this.mMenViewAddConnectionPanel.Size = new System.Drawing.Size(228, 22);
this.mMenViewAddConnectionPanel.Size = new System.Drawing.Size(227, 22);
this.mMenViewAddConnectionPanel.Text = "Add Connection Panel";
this.mMenViewAddConnectionPanel.Click += new System.EventHandler(this.mMenViewAddConnectionPanel_Click);
//
@@ -371,13 +370,13 @@ namespace mRemoteNG.UI.Forms
//
this.mMenViewConnectionPanels.Image = global::mRemoteNG.Resources.Panels;
this.mMenViewConnectionPanels.Name = "mMenViewConnectionPanels";
this.mMenViewConnectionPanels.Size = new System.Drawing.Size(228, 22);
this.mMenViewConnectionPanels.Size = new System.Drawing.Size(227, 22);
this.mMenViewConnectionPanels.Text = "Connection Panels";
//
// mMenViewSep1
//
this.mMenViewSep1.Name = "mMenViewSep1";
this.mMenViewSep1.Size = new System.Drawing.Size(225, 6);
this.mMenViewSep1.Size = new System.Drawing.Size(224, 6);
//
// mMenViewConnections
//
@@ -385,7 +384,7 @@ namespace mRemoteNG.UI.Forms
this.mMenViewConnections.CheckState = System.Windows.Forms.CheckState.Checked;
this.mMenViewConnections.Image = global::mRemoteNG.Resources.Root;
this.mMenViewConnections.Name = "mMenViewConnections";
this.mMenViewConnections.Size = new System.Drawing.Size(228, 22);
this.mMenViewConnections.Size = new System.Drawing.Size(227, 22);
this.mMenViewConnections.Text = "Connections";
this.mMenViewConnections.Click += new System.EventHandler(this.mMenViewConnections_Click);
//
@@ -395,7 +394,7 @@ namespace mRemoteNG.UI.Forms
this.mMenViewConfig.CheckState = System.Windows.Forms.CheckState.Checked;
this.mMenViewConfig.Image = global::mRemoteNG.Resources.cog;
this.mMenViewConfig.Name = "mMenViewConfig";
this.mMenViewConfig.Size = new System.Drawing.Size(228, 22);
this.mMenViewConfig.Size = new System.Drawing.Size(227, 22);
this.mMenViewConfig.Text = "Config";
this.mMenViewConfig.Click += new System.EventHandler(this.mMenViewConfig_Click);
//
@@ -405,7 +404,7 @@ namespace mRemoteNG.UI.Forms
this.mMenViewErrorsAndInfos.CheckState = System.Windows.Forms.CheckState.Checked;
this.mMenViewErrorsAndInfos.Image = global::mRemoteNG.Resources.ErrorsAndInfos;
this.mMenViewErrorsAndInfos.Name = "mMenViewErrorsAndInfos";
this.mMenViewErrorsAndInfos.Size = new System.Drawing.Size(228, 22);
this.mMenViewErrorsAndInfos.Size = new System.Drawing.Size(227, 22);
this.mMenViewErrorsAndInfos.Text = "Errors and Infos";
this.mMenViewErrorsAndInfos.Click += new System.EventHandler(this.mMenViewErrorsAndInfos_Click);
//
@@ -413,14 +412,14 @@ namespace mRemoteNG.UI.Forms
//
this.mMenViewScreenshotManager.Image = ((System.Drawing.Image)(resources.GetObject("mMenViewScreenshotManager.Image")));
this.mMenViewScreenshotManager.Name = "mMenViewScreenshotManager";
this.mMenViewScreenshotManager.Size = new System.Drawing.Size(228, 22);
this.mMenViewScreenshotManager.Size = new System.Drawing.Size(227, 22);
this.mMenViewScreenshotManager.Text = "Screenshot Manager";
this.mMenViewScreenshotManager.Click += new System.EventHandler(this.mMenViewScreenshotManager_Click);
//
// ToolStripSeparator1
//
this.ToolStripSeparator1.Name = "ToolStripSeparator1";
this.ToolStripSeparator1.Size = new System.Drawing.Size(225, 6);
this.ToolStripSeparator1.Size = new System.Drawing.Size(224, 6);
//
// mMenViewJumpTo
//
@@ -429,7 +428,7 @@ namespace mRemoteNG.UI.Forms
this.mMenViewJumpToErrorsInfos});
this.mMenViewJumpTo.Image = global::mRemoteNG.Resources.JumpTo;
this.mMenViewJumpTo.Name = "mMenViewJumpTo";
this.mMenViewJumpTo.Size = new System.Drawing.Size(228, 22);
this.mMenViewJumpTo.Size = new System.Drawing.Size(227, 22);
this.mMenViewJumpTo.Text = "Jump To";
//
// mMenViewJumpToConnectionsConfig
@@ -456,20 +455,20 @@ namespace mRemoteNG.UI.Forms
//
this.mMenViewResetLayout.Image = global::mRemoteNG.Resources.application_side_tree;
this.mMenViewResetLayout.Name = "mMenViewResetLayout";
this.mMenViewResetLayout.Size = new System.Drawing.Size(228, 22);
this.mMenViewResetLayout.Size = new System.Drawing.Size(227, 22);
this.mMenViewResetLayout.Text = "Reset Layout";
this.mMenViewResetLayout.Click += new System.EventHandler(this.mMenViewResetLayout_Click);
//
// mMenViewSep2
//
this.mMenViewSep2.Name = "mMenViewSep2";
this.mMenViewSep2.Size = new System.Drawing.Size(225, 6);
this.mMenViewSep2.Size = new System.Drawing.Size(224, 6);
//
// mMenViewQuickConnectToolbar
//
this.mMenViewQuickConnectToolbar.Image = global::mRemoteNG.Resources.Play_Quick;
this.mMenViewQuickConnectToolbar.Name = "mMenViewQuickConnectToolbar";
this.mMenViewQuickConnectToolbar.Size = new System.Drawing.Size(228, 22);
this.mMenViewQuickConnectToolbar.Size = new System.Drawing.Size(227, 22);
this.mMenViewQuickConnectToolbar.Text = "Quick Connect Toolbar";
this.mMenViewQuickConnectToolbar.Click += new System.EventHandler(this.mMenViewQuickConnectToolbar_Click);
//
@@ -477,21 +476,21 @@ namespace mRemoteNG.UI.Forms
//
this.mMenViewExtAppsToolbar.Image = global::mRemoteNG.Resources.ExtApp;
this.mMenViewExtAppsToolbar.Name = "mMenViewExtAppsToolbar";
this.mMenViewExtAppsToolbar.Size = new System.Drawing.Size(228, 22);
this.mMenViewExtAppsToolbar.Size = new System.Drawing.Size(227, 22);
this.mMenViewExtAppsToolbar.Text = "External Applications Toolbar";
this.mMenViewExtAppsToolbar.Click += new System.EventHandler(this.mMenViewExtAppsToolbar_Click);
//
// mMenViewSep3
//
this.mMenViewSep3.Name = "mMenViewSep3";
this.mMenViewSep3.Size = new System.Drawing.Size(225, 6);
this.mMenViewSep3.Size = new System.Drawing.Size(224, 6);
//
// mMenViewFullscreen
//
this.mMenViewFullscreen.Image = global::mRemoteNG.Resources.arrow_out;
this.mMenViewFullscreen.Name = "mMenViewFullscreen";
this.mMenViewFullscreen.ShortcutKeys = System.Windows.Forms.Keys.F11;
this.mMenViewFullscreen.Size = new System.Drawing.Size(228, 22);
this.mMenViewFullscreen.Size = new System.Drawing.Size(227, 22);
this.mMenViewFullscreen.Text = "Full Screen";
this.mMenViewFullscreen.Click += new System.EventHandler(this.mMenViewFullscreen_Click);
//
@@ -506,7 +505,7 @@ namespace mRemoteNG.UI.Forms
this.mMenToolsComponentsCheck,
this.mMenToolsOptions});
this.mMenTools.Name = "mMenTools";
this.mMenTools.Size = new System.Drawing.Size(48, 20);
this.mMenTools.Size = new System.Drawing.Size(47, 20);
this.mMenTools.Text = "&Tools";
//
// mMenToolsSSHTransfer
@@ -573,7 +572,6 @@ namespace mRemoteNG.UI.Forms
this.mMenInfoForum,
this.mMenInfoBugReport,
this.ToolStripSeparator2,
this.mMenInfoAnnouncements,
this.mMenToolsUpdate,
this.mMenInfoSep2,
this.mMenInfoAbout});
@@ -633,14 +631,6 @@ namespace mRemoteNG.UI.Forms
this.ToolStripSeparator2.Name = "ToolStripSeparator2";
this.ToolStripSeparator2.Size = new System.Drawing.Size(187, 6);
//
// mMenInfoAnnouncements
//
this.mMenInfoAnnouncements.Image = global::mRemoteNG.Resources.News;
this.mMenInfoAnnouncements.Name = "mMenInfoAnnouncements";
this.mMenInfoAnnouncements.Size = new System.Drawing.Size(190, 22);
this.mMenInfoAnnouncements.Text = "Announcements";
this.mMenInfoAnnouncements.Click += new System.EventHandler(this.mMenInfoAnnouncements_Click);
//
// mMenToolsUpdate
//
this.mMenToolsUpdate.Image = global::mRemoteNG.Resources.Update;
@@ -700,9 +690,9 @@ namespace mRemoteNG.UI.Forms
//
// tsContainer.TopToolStripPanel
//
this.tsContainer.TopToolStripPanel.Controls.Add(this.msMain);
this.tsContainer.TopToolStripPanel.Controls.Add(this.tsQuickConnect);
this.tsContainer.TopToolStripPanel.Controls.Add(this.tsExternalTools);
this.tsContainer.TopToolStripPanel.Controls.Add(this.msMain);
this.tsContainer.TopToolStripPanel.Controls.Add(this.ToolStrip1);
//
// tsQuickConnect
@@ -713,7 +703,7 @@ namespace mRemoteNG.UI.Forms
this.cmbQuickConnect,
this.btnQuickConnect,
this.btnConnections});
this.tsQuickConnect.Location = new System.Drawing.Point(274, 0);
this.tsQuickConnect.Location = new System.Drawing.Point(179, 0);
this.tsQuickConnect.MaximumSize = new System.Drawing.Size(0, 25);
this.tsQuickConnect.Name = "tsQuickConnect";
this.tsQuickConnect.Size = new System.Drawing.Size(387, 25);
@@ -772,14 +762,14 @@ namespace mRemoteNG.UI.Forms
this.cMenExtAppsToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cMenToolbarShowText});
this.cMenExtAppsToolbar.Name = "cMenToolbar";
this.cMenExtAppsToolbar.Size = new System.Drawing.Size(129, 26);
this.cMenExtAppsToolbar.Size = new System.Drawing.Size(128, 26);
//
// cMenToolbarShowText
//
this.cMenToolbarShowText.Checked = true;
this.cMenToolbarShowText.CheckState = System.Windows.Forms.CheckState.Checked;
this.cMenToolbarShowText.Name = "cMenToolbarShowText";
this.cMenToolbarShowText.Size = new System.Drawing.Size(128, 22);
this.cMenToolbarShowText.Size = new System.Drawing.Size(127, 22);
this.cMenToolbarShowText.Text = "Show Text";
this.cMenToolbarShowText.Click += new System.EventHandler(this.cMenToolbarShowText_Click);
//
@@ -933,7 +923,6 @@ namespace mRemoteNG.UI.Forms
internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator1;
internal System.Windows.Forms.ToolStripMenuItem mMenToolsUVNCSC;
internal System.Windows.Forms.ToolStripMenuItem mMenToolsComponentsCheck;
internal System.Windows.Forms.ToolStripMenuItem mMenInfoAnnouncements;
internal System.Windows.Forms.ToolStripSeparator mMenInfoSep2;
internal System.Windows.Forms.ToolStripMenuItem mMenInfoBugReport;
internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator2;

View File

@@ -229,7 +229,6 @@ namespace mRemoteNG.UI.Forms
mMenInfoDonate.Text = Language.strMenuDonate;
mMenInfoWebsite.Text = Language.strMenuWebsite;
mMenInfoAbout.Text = Language.strMenuAbout;
mMenInfoAnnouncements.Text = Language.strMenuAnnouncements;
lblQuickConnect.Text = Language.strLabelConnect;
btnQuickConnect.Text = Language.strMenuConnect;
@@ -288,7 +287,7 @@ namespace mRemoteNG.UI.Forms
private void frmMain_Shown(object sender, EventArgs e)
{
#if PORTABLE
// ReSharper disable once RedundantJumpStatement
// ReSharper disable once RedundantJumpStatement
return;
#endif
if (!Settings.Default.CheckForUpdatesAsked)
@@ -955,11 +954,6 @@ namespace mRemoteNG.UI.Forms
Runtime.GoToDonate();
}
private void mMenInfoAnnouncements_Click(object sender, EventArgs e)
{
Windows.Show(WindowType.Announcement);
}
private void mMenInfoAbout_Click(object sender, EventArgs e)
{
Windows.Show(WindowType.About);
@@ -976,20 +970,19 @@ namespace mRemoteNG.UI.Forms
MouseUpEventHandler = ConnectionsMenuItem_MouseUp
};
// ReSharper disable once CoVariantArrayConversion
ToolStripItem[] rootMenuItems = menuItemsConverter.CreateToolStripDropDownItems(Runtime.ConnectionTreeModel).ToArray();
btnConnections.DropDownItems.AddRange(rootMenuItems);
}
private static void ConnectionsMenuItem_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
var tag = ((ToolStripMenuItem)sender).Tag as ConnectionInfo;
if (tag != null)
{
ConnectionInitiator.OpenConnection(tag);
}
}
if (e.Button != MouseButtons.Left) return;
var tag = ((ToolStripMenuItem)sender).Tag as ConnectionInfo;
if (tag != null)
{
ConnectionInitiator.OpenConnection(tag);
}
}
#endregion

View File

@@ -1,41 +0,0 @@
using mRemoteNG.My;
namespace mRemoteNG.UI.Window
{
public partial class AnnouncementWindow
{
#region Windows Form Designer generated code
internal System.Windows.Forms.WebBrowser webBrowser;
private void InitializeComponent()
{
this.webBrowser = new System.Windows.Forms.WebBrowser();
this.Load += new System.EventHandler(Announcement_Load);
this.SuspendLayout();
//
//webBrowser
//
this.webBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
this.webBrowser.Location = new System.Drawing.Point(0, 0);
this.webBrowser.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser.Name = "webBrowser";
this.webBrowser.Size = new System.Drawing.Size(549, 474);
this.webBrowser.TabIndex = 0;
//
//Announcement
//
this.ClientSize = new System.Drawing.Size(549, 474);
this.Controls.Add(this.webBrowser);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, System.Convert.ToByte(0));
this.Icon = Resources.News_Icon;
this.Name = "Announcement";
this.TabText = "Announcement";
this.Text = "Announcement";
this.ResumeLayout(false);
}
#endregion
}
}

View File

@@ -1,95 +0,0 @@
using System;
using System.ComponentModel;
using WeifenLuo.WinFormsUI.Docking;
using mRemoteNG.App;
using mRemoteNG.App.Update;
namespace mRemoteNG.UI.Window
{
public partial class AnnouncementWindow : BaseWindow
{
#region Public Methods
public AnnouncementWindow(DockContent panel)
{
WindowType = WindowType.Announcement;
DockPnl = panel;
InitializeComponent();
}
#endregion
#region Private Fields
private AppUpdater _appUpdate;
#endregion
#region Private Methods
public void Announcement_Load(object sender, EventArgs e)
{
webBrowser.Navigated += webBrowser_Navigated;
ApplyLanguage();
CheckForAnnouncement();
}
private void ApplyLanguage()
{
}
private void webBrowser_Navigated(object sender, System.Windows.Forms.WebBrowserNavigatedEventArgs e)
{
// This can only be set once the WebBrowser control is shown, it will throw a COM exception otherwise.
webBrowser.AllowWebBrowserDrop = false;
webBrowser.Navigated -= webBrowser_Navigated;
}
private void CheckForAnnouncement()
{
if (_appUpdate == null)
{
_appUpdate = new AppUpdater();
//_appUpdate.Load += _appUpdate.Update_Load;
}
else if (_appUpdate.IsGetAnnouncementInfoRunning)
{
return ;
}
_appUpdate.GetAnnouncementInfoCompletedEvent += GetAnnouncementInfoCompleted;
_appUpdate.GetAnnouncementInfoAsync();
}
private void GetAnnouncementInfoCompleted(object sender, AsyncCompletedEventArgs e)
{
if (InvokeRequired)
{
AsyncCompletedEventHandler myDelegate = new AsyncCompletedEventHandler(GetAnnouncementInfoCompleted);
Invoke(myDelegate, new object[] {sender, e});
return ;
}
try
{
_appUpdate.GetAnnouncementInfoCompletedEvent -= GetAnnouncementInfoCompleted;
if (e.Cancelled)
{
return ;
}
if (e.Error != null)
{
throw (e.Error);
}
webBrowser.Navigate(_appUpdate.CurrentAnnouncementInfo.Address);
}
catch (Exception ex)
{
Runtime.MessageCollector.AddExceptionMessage(Language.strUpdateGetAnnouncementInfoFailed, ex);
}
}
#endregion
}
}

View File

@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -413,12 +413,6 @@
<Compile Include="UI\Window\ActiveDirectoryImportWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\Window\AnnouncementWindow.Designer.cs">
<DependentUpon>AnnouncementWindow.cs</DependentUpon>
</Compile>
<Compile Include="UI\Window\AnnouncementWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\Window\BaseWindow.cs">
<SubType>Form</SubType>
</Compile>
@@ -602,10 +596,6 @@
<DependentUpon>ActiveDirectoryImportWindow.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\Window\AnnouncementWindow.resx">
<DependentUpon>AnnouncementWindow.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\Window\ComponentsCheckWindow.resx">
<DependentUpon>ComponentsCheckWindow.cs</DependentUpon>
<SubType>Designer</SubType>