diff --git a/XenAdmin/Controls/FilterLocationToolStripDropDownButton.cs b/XenAdmin/Controls/FilterLocationToolStripDropDownButton.cs index 31285d535..47d3aa4e1 100644 --- a/XenAdmin/Controls/FilterLocationToolStripDropDownButton.cs +++ b/XenAdmin/Controls/FilterLocationToolStripDropDownButton.cs @@ -286,12 +286,12 @@ namespace XenAdmin.Controls private void connection_ConnectionStateChanged(object sender, EventArgs e) { - Program.Invoke(Parent, RefreshLists); + Program.Invoke(Program.MainWindow, RefreshLists); } private void connection_CachePopulated(object sender, EventArgs e) { - Program.Invoke(Parent, RefreshLists); + Program.Invoke(Program.MainWindow, RefreshLists); } private void XenConnections_CollectionChanged(object sender, CollectionChangeEventArgs e) diff --git a/XenAdmin/Controls/MainWindowControls/NavigationView.cs b/XenAdmin/Controls/MainWindowControls/NavigationView.cs index d14293291..3850ebcc9 100644 --- a/XenAdmin/Controls/MainWindowControls/NavigationView.cs +++ b/XenAdmin/Controls/MainWindowControls/NavigationView.cs @@ -313,7 +313,7 @@ namespace XenAdmin.Controls.MainWindowControls public void RequestRefreshTreeView() { - Program.BeginInvoke(this, treeViewUpdateManager.RequestUpdate); + Program.BeginInvoke(Program.MainWindow, treeViewUpdateManager.RequestUpdate); } private void SuspendRefreshTreeView() @@ -345,7 +345,7 @@ namespace XenAdmin.Controls.MainWindowControls if (Disposing || IsDisposed || Program.Exiting) return; - Program.Invoke(this, () => + Program.Invoke(Program.MainWindow, () => { if (ignoreRefreshTreeView > 0) { diff --git a/XenAdmin/TabPages/AlertSummaryPage.cs b/XenAdmin/TabPages/AlertSummaryPage.cs index 17edf8a3f..708bd692a 100644 --- a/XenAdmin/TabPages/AlertSummaryPage.cs +++ b/XenAdmin/TabPages/AlertSummaryPage.cs @@ -139,7 +139,7 @@ namespace XenAdmin.TabPages // 4) Take the top n as set by the filters // 5) Add them to the control using the optimized AddRange() - Program.Invoke(this, SetFilterLabel); + Program.Invoke(Program.MainWindow, SetFilterLabel); List alerts = Alert.NonDismissingAlerts; alerts.RemoveAll(FilterAlert); @@ -179,7 +179,7 @@ namespace XenAdmin.TabPages alerts.RemoveRange(ALERT_CAP, alerts.Count - ALERT_CAP); } - Program.Invoke(this, delegate + Program.Invoke(Program.MainWindow, delegate { List gridRows = new List(); log.Debug("Rebuilding alertList: Adding alert rows"); @@ -282,7 +282,7 @@ namespace XenAdmin.TabPages private bool FilterAlert(Alert alert) { bool hide = false; - Program.Invoke(this, () => + Program.Invoke(Program.MainWindow, () => hide = toolStripDropDownButtonDateFilter.HideByDate(alert.Timestamp.ToLocalTime()) || toolStripDropDownButtonServerFilter.HideByLocation(alert.HostUuid) || toolStripDropDownSeveritiesFilter.HideBySeverity(alert.Priority)); diff --git a/XenAdmin/TabPages/HistoryPage.cs b/XenAdmin/TabPages/HistoryPage.cs index 10d22f315..ebe275c35 100644 --- a/XenAdmin/TabPages/HistoryPage.cs +++ b/XenAdmin/TabPages/HistoryPage.cs @@ -121,7 +121,7 @@ namespace XenAdmin.TabPages if (asyncAction != null) asyncAction.RecomputeCanCancel(); - Program.Invoke(this, () => + Program.Invoke(Program.MainWindow, () => { var row = FindRowFromAction(sender); if (row != null) @@ -203,7 +203,7 @@ namespace XenAdmin.TabPages private bool FilterAction(ActionBase action) { bool hide = false; - Program.Invoke(this, () => + Program.Invoke(Program.MainWindow, () => hide = toolStripDdbFilterDates.HideByDate(action.Started) || toolStripDdbFilterLocation.HideByLocation(action.GetApplicableHosts()) || toolStripDdbFilterStatus.HideByStatus(action)); diff --git a/XenAdmin/TabPages/ManageUpdatesPage.cs b/XenAdmin/TabPages/ManageUpdatesPage.cs index 532b8895a..c88fa980d 100644 --- a/XenAdmin/TabPages/ManageUpdatesPage.cs +++ b/XenAdmin/TabPages/ManageUpdatesPage.cs @@ -84,12 +84,12 @@ namespace XenAdmin.TabPages private void UpdatesCollectionChanged(object sender, EventArgs e) { - Program.Invoke(this, Rebuild); + Program.Invoke(Program.MainWindow, Rebuild); } private void CheckForUpdates_CheckForUpdatesStarted() { - Program.Invoke(this, () => + Program.Invoke(Program.MainWindow, () => { checksQueue++; if (checksQueue > 1) @@ -106,7 +106,7 @@ namespace XenAdmin.TabPages private void CheckForUpdates_CheckForUpdatesCompleted(bool succeeded, string errorMessage) { - Program.Invoke(this, delegate + Program.Invoke(Program.MainWindow, delegate { checksQueue--; toolStripButtonRefresh.Enabled = true; @@ -258,7 +258,7 @@ namespace XenAdmin.TabPages hosts = serverUpdate.DistinctHosts.Select(h => h.uuid).ToList(); bool hide = false; - Program.Invoke(this, () => + Program.Invoke(Program.MainWindow, () => hide = toolStripDropDownButtonDateFilter.HideByDate(alert.Timestamp.ToLocalTime()) || toolStripDropDownButtonServerFilter.HideByLocation(hosts)); return hide; diff --git a/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeUpgradePage.cs b/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeUpgradePage.cs index 8213871df..3d1e653fa 100644 --- a/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeUpgradePage.cs +++ b/XenAdmin/Wizards/RollingUpgradeWizard/RollingUpgradeUpgradePage.cs @@ -421,7 +421,7 @@ namespace XenAdmin.Wizards.RollingUpgradeWizard foreach (DataGridViewRowUpgrade row in rowsForHost) { DataGridViewRowUpgrade closureRow = row; - Program.Invoke(this, () => closureRow.UpdateStatus(HostUpgradeState.Upgrading, plan.Status)); + Program.Invoke(Program.MainWindow, () => closureRow.UpdateStatus(HostUpgradeState.Upgrading, plan.Status)); } }